I am reading in xml files that look like this:
<?xml version="1.0" encoding="UTF-8" ?>
<menusman>
    <menuman name="首页"></menuman>
</menusman>

This function works fine for English, 
but when they hit the first Chinese character, the file handle returns a fail,
which causes the loop to exit before it reads in the file.

std::wstring line;        
std::wifstream myfile ("filename.xml");
std::wstring myTemplate;
if (myfile.is_open())
{
  while (getline (myfile, line))
  {
      myTemplate.append(line);
  }
  myfile.close();
}

If I add: 
std::locale::global(std::locale(""));
before opening the file, it works fine,
but the app starts behaving strange, 
I get:
?wtd=0hI0BFZV1efPPIGw&signal=s89
on the path, and the style sheets do not load,
I tried to set setLocale(""), but it did not help,
does anyone know how to fix this?

Maybe I need to use imbue,
but no luck at that so far.

Thanks
Jeff Flesher

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to