[xsd-users] Serialization and extended ascii characters.

jan.noorland at iff.com jan.noorland at iff.com
Mon Jun 9 04:08:28 EDT 2008


Thanks Boris for pointing me in the right direction.

Option 2 was sufficient to fix the problem.

Best Regards,

Jan.




Boris Kolpackov <boris at codesynthesis.com> 
06/06/2008 03:12 PM

To
jan.noorland at iff.com
cc
xsd-users at codesynthesis.com
Subject
Re: [xsd-users] Serialization and extended ascii characters.






Hi Jan,

jan.noorland at iff.com <jan.noorland at iff.com> writes:

> My code is build with Visual C++ 2003 and the input data is defined as 
> char. The character is a valid ISO Latin-1 character (á = 0xE1).

Yes, but it is not a valid UTF-8 character. The same character in
UTF-8 will be represented as a 2-byte sequence: 0xC3 0xA1.


> Does it imply that I need to use the --char-type wchar_t parameter to 
> regenerate the XSD code?

You have three options here:

1. Use 'char' as the character type and represent non-ASCII characters as
   proper UTF-8 sequences.

2. Use 'char' as the character type and compile your code with XSD_USE_LCP
   macro defined. If your and all your user's Windows is configured to use
   ISO Latin-1 as an encoding then everything should work.

3. Use 'wchar_t' as the character type (compile your schemas with
   --char-type wchar_t) and use UTF-16 representation for 0xE1
   which is 0x00E1 (L"á" will probably also work).

Boris




* * * * * * * * * *

This communication contains information of International Flavors & 
Fragrances (IFF) and/or its affiliates that may be confidential, 
proprietary, copyrighted and/or legally privileged, and is intended only 
for the addressee. Any copying, dissemination or other use of this 
information by anyone other than the intended recipient is prohibited. If 
you have received this communication in error, please contact the sender 
and delete it from your system.


More information about the xsd-users mailing list