« The Internet Explorer… | Home | Xojo 2013r2 released »

Fighting Text Encoding Trouble

We often see people with problems with text encoding. For example they use MySQL Database with MySQLCommunityServer database class to query values. Those string values from recordset have no text encoding defined and they need to define one depending on which text encoding they do use with the plugin.
Now those strings without text encoding defined are passed to various functions. Our plugins as well as the Xojo framework have fallback code to handle this. More or less we either guess or we assume an encoding. Our MBS Plugins generally assume the platform encoding which is for example Windows ANSI on Windows. But when you pass around those strings you may expect some unexpected behaviors. Like umlauts going away or asian characters not drawn properly.

So for DynaPDF plugin we add a new option. A ValidateTextEncodings property. If you set it to true and you pass a string without defined encoding, we raise an UnsupportedFormatException to notify you.

If you like, take the next plugins, set the option to true and try your app. It may help you to find bugs with text encodings.
16 07 13 - 11:54
No comments

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.