funny characters for - and '

Discussions related to custom development with Select.
Post Reply
czentman
Posts: 157
Joined: Tue Dec 02, 2008 12:02 pm

funny characters for - and '

Post by czentman »

there are funny characters appearing when requirements/exception taken with api after converted rtf. There is ’ for apostrophe (but I think not in place of), and †instead of hyphen. Is there a font file that I may be missing?
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: funny characters for - and '

Post by BobRichards »

There is no missing font file. This type of encoding problem occurs if the original text was represented in UTF-8 and rendered as an ASCII variant (ISO 8859-1, etc.). UTF-8 encoding can take multiple bytes to represent a single character. In this case, the apostrophe (which might be left-leaning, right-leaning, or straight up) takes more than one byte in UTF-8 encoding. When the bytes are assumed to be ASCII (by your renderer), each byte is assumed to be encoded in ASCII and it displays unintended characters. The hint is the â since that is generally the first ASCII character when the encoding is ignored.

You should Google something like "encoding UTF-8 into ASCII" to find examples on how to properly convert encodings. Be aware that you will always have these types of issues if you paste text from Word (etc.) into Rich Text Controls where the characters are em-dashes/en-dashes, angled double-quotes or any other stylized character.
Bob Richards, Senior Software Developer, SoftPro
Post Reply