Luigi Carlotto
2008-12-14 12:08:36 UTC
In my application I execute a rescue on XML file of some data.
The rescue executes before a conversion: Conv (string, “UTF-8”, “ASCII”)
During my tests, I have noticed that some errors are taken place:
1) if the string is larger than 2000 characters (approximately),
XmlWrite.Attribute() crash;
2) if the language comes set up to Chinese (UTF-8), the conversion with
Conv() crash; same behavior if is used XmlWrite.Attribute(), or
XmlWrite.Element(), without to execute conversions.
I have noticed that the errors take place alone if System.Language=zh_CN
and System.Charset=UTF-8, while with various languages seems to go all
good.
Error message:
encoding error : output conversion failed due to conv error, bytes 0xE5
0x31 0x32 0xE5
I/O error : encoder error
The bytes indicated from the message they do not seem to correspond,
neither are comprised, in no string between those which they come saved
in XML file.
To notice that the reading from XML file is OK, while the writing
finishes with the error described in mine precedence mail, if the
writing of XML file with System.Language=zh_CN (Chinese); with other
languages (Italian, French, English and Spanish) it is all to OK.
The rescue executes before a conversion: Conv (string, “UTF-8”, “ASCII”)
During my tests, I have noticed that some errors are taken place:
1) if the string is larger than 2000 characters (approximately),
XmlWrite.Attribute() crash;
2) if the language comes set up to Chinese (UTF-8), the conversion with
Conv() crash; same behavior if is used XmlWrite.Attribute(), or
XmlWrite.Element(), without to execute conversions.
I have noticed that the errors take place alone if System.Language=zh_CN
and System.Charset=UTF-8, while with various languages seems to go all
good.
Error message:
encoding error : output conversion failed due to conv error, bytes 0xE5
0x31 0x32 0xE5
I/O error : encoder error
The bytes indicated from the message they do not seem to correspond,
neither are comprised, in no string between those which they come saved
in XML file.
To notice that the reading from XML file is OK, while the writing
finishes with the error described in mine precedence mail, if the
writing of XML file with System.Language=zh_CN (Chinese); with other
languages (Italian, French, English and Spanish) it is all to OK.