Converting UTF-8 strings from ISaxParser to a form suitable for gui handling | developer.brewmp.com Converting UTF-8 strings from ISaxParser to a form suitable for gui handling | developer.brewmp.com

Developer

Converting UTF-8 strings from ISaxParser to a form suitable for gui handling

Forums:

I am using ISaxParser to parse XML files that may contain strings in a variety of languages, the API for ISaxParser provides the parsed data as a char*.

If I want to pass this data to a GUI for display I'm assuming I should convert it into an ARCHAR* via ucs_Utf8ToUtf16().

Is my assumption correct?

 

Also how should a return of

AEE_EBADITEM from ucs_Utf8ToUtf16() be dealt with? The documentation says to refer to "Handling invalid characters" for more information but I can't find this.

ucs_Utf8ToUtf16() would work correctly only in the case your XML encoding is UTF-8.
you may also check out ICharsetConv for this purpose.
Handling Invalid Characters: this topic is under documentation of UCS (APIReference > System > Application > Interfaces > UCS >)

ucs_Utf8ToUtf16() would work correctly only in the case your XML encoding is UTF-8.
you may also check out ICharsetConv for this purpose.
Handling Invalid Characters: this topic is under documentation of UCS (APIReference > System > Application > Interfaces > UCS >)

Seems lots of people have problems with ICharsetConv, as do I, for which nobody has replied with the problem/solution (the example documentation code copied verbatim doesn't work, as seen from one of these links).
https://developer.brewmp.com/forum/icharsetconvert
 
https://developer.brewmp.com/forum/icharsetconvcharsetconvert-returns-eu...

Seems lots of people have problems with ICharsetConv, as do I, for which nobody has replied with the problem/solution (the example documentation code copied verbatim doesn't work, as seen from one of these links).
https://developer.brewmp.com/forum/icharsetconvert
 
https://developer.brewmp.com/forum/icharsetconvcharsetconvert-returns-eu...

currently there seems to be some issue with UTF-8 to UTF-16 conversion using ICharSetConv.all other conversions should work, like i checked UTF-8 to Shift_JIS , UTF-16 to UTF-8.
you may use ucs_Utf8ToUtf16() in AEEucs.h for now for converting of UTF-8 to UTF-16. Note: After ICharsetConv_CharsetConvert() is exicuted, the source & the destination buffer pointers are moved forward to the Last consumed byte & last produced byte respectively. So you may need to store the original pointers you pass, to use the results later.

currently there seems to be some issue with UTF-8 to UTF-16 conversion using ICharSetConv.all other conversions should work, like i checked UTF-8 to Shift_JIS , UTF-16 to UTF-8.
you may use ucs_Utf8ToUtf16() in AEEucs.h for now for converting of UTF-8 to UTF-16. Note: After ICharsetConv_CharsetConvert() is exicuted, the source & the destination buffer pointers are moved forward to the Last consumed byte & last produced byte respectively. So you may need to store the original pointers you pass, to use the results later.