You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Alberto Massari (JIRA)" <xe...@xml.apache.org> on 2012/10/15 20:08:03 UTC

[jira] [Closed] (XERCESC-2002) XMLString::transcode for multi-byte characters are returning null on Linux

     [ https://issues.apache.org/jira/browse/XERCESC-2002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alberto Massari closed XERCESC-2002.
------------------------------------

    Resolution: Invalid

XMLString::transcode converts to/from the current locale. It's up to the user to guarantee that the char* specified as argument is a valid string for the current locale. I guess your locale is not UTF-8, and so the conversion fails. 
You should create a transcoder for the encoding of the input string, and use XMLString::transcode only for data coming from stdin, or being printed to stdout
                
> XMLString::transcode for multi-byte characters are returning null on Linux 
> ---------------------------------------------------------------------------
>
>                 Key: XERCESC-2002
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2002
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Miscellaneous
>    Affects Versions: 2.7.0
>            Reporter: Ratnesh Nath
>            Priority: Critical
>
> XMLCh *tag1 = XMLString::transcode("test-in-english");
> Printing: CsEws::XmlChToString(tag1).c_str()); >>>>>>> output is : test-in-english
> XMLCh *tag2 = XMLString::transcode("ã«ã¯");
> Printing: CsEws::XmlChToString(tag1).c_str()); >>>>>>> output is :  <<< NULL

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org