Home > Software engineering >  C set the value of an XML file appears in the code
C set the value of an XML file appears in the code

Time:09-27

Used in WTL TiXmlDocument to wrong left an XML file,
TiXmlElement * aaa=new TiXmlElement (" NAME ");
RootElement - & gt; LinkEndChild (aaa);
DIRElement - & gt; The SetAttribute (" STR ", "system");
Open the XML file, the system of two words are garbled, change system to other Chinese, is normal:
"?? ""

CodePudding user response:

XML encoding problem, try to GBK

CodePudding user response:

How to change the other will not be in Chinese

CodePudding user response:

Really don't understand why only the "system" two words will garbled

CodePudding user response:

Your problem solved

CodePudding user response:

For computer no noise, only the binary bytes; To the human brain is gibberish, GBK: 0 xb0 0 xa1, Unicode - 16 LE: 0 x4a 0 x55, Unicode - 16 BE: 0 x55 0 x4a, utf-8 8-0 x95 xE5 0 0 x8a

CodePudding user response:

Tinyxml supports only UTF8 encoding, you can't write Chinese directly, Chinese constants default UNICODE or ANSI, need transcoding in UTF8
  • Related