« XDev Magazine 11.4, P… | 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. The biggest plugin in space...
16 07 13 - 11:54