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 2010/04/13 10:56:49 UTC

[jira] Resolved: (XERCESC-1916) TranscodeFromStr fails with invalid UTF8 encoded strings

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

Alberto Massari resolved XERCESC-1916.
--------------------------------------

         Assignee: Alberto Massari
    Fix Version/s: 3.1.1
       Resolution: Fixed

TranscodeToStr and TranscodeFromStr now throw an exception if the internal transcoder doesn't advance the cursor; instead, the transcodeTo and transcodeFrom method exposed by the transcoders must return "0 bytes processed" to allow for incremental conversions (it's up to the caller to add more data and call the method again)

Alberto

> TranscodeFromStr fails with invalid UTF8 encoded strings
> --------------------------------------------------------
>
>                 Key: XERCESC-1916
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1916
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Utilities
>         Environment: WIN32, Solaris32
>            Reporter: Kristian Ivarsson
>            Assignee: Alberto Massari
>             Fix For: 3.1.1, 3.2.0
>
>
> If you got an invalid encoded UTF-8-sequence, the TranscodeFromStr ends up by throwing a OutOfMemoryException and if you use XMLTranscoder::transcodeFrom() directly you'll somehow probably end up in a loop that never ends, 'cause it stops to consume/eat bytes. Shouldn't there be some "InvalidEncodingException" instead ?
> ...
> const char string[] = "HÖPP";
> const int size = strlen( string);
> xercesc::TranscodeFromStr transcoder( reinterpret_cast<const XMLByte *>(string), size, "UTF8");
> // OutOfMemoryException

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
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