I am using TxtConvertEncoding function to convert my text buffer from
charEncodingUCS2 to system encoding ( ISO-8859-1) on Cobalt. While doing
this, sometimes the encoding fails and returns the error value
txtErrNoCharMapping. I ORed destination encoding value with
charEncodingDstBestFitFlag while calling TxtConvertEncoding, but still that
problem is there. Can anyone tell me why I am getting this problem on
Cobalt?  Thanking you in advance.

If your input stream (of UCS-2 encoded Unicode text) contains a character that can't be mapped to the device character encoding, then you'll get the txtErrNoCharMapping result. This will happen even if you specify the best fit flag, as that merely "tries harder" to find an approximate mapping to something in the device encoding (versus an exact, round-trippable mapping).


So, for example, if you input text contains a Kanji character, and you're converting to PalmLatin, then there's going to be no possible mapping.

Note that when this error is returned, the source offset (an in/out parameter) should be set to the offset of the unmappable character.

Also note that if you pass in a substitution string, then you would still get an error returned, but all of the input text will be processed, and any unmappable character will be replaced by the substitution string.

And finally, all of this is, or should be, explained by the documentation that is part of the SDK.

-- Ken
--
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to