PHP-GTKers working in English-related applications, don't have a problem with debugging messages output to a console when debugging, but applications on a more international front have issues with their output. But help has been found in this new post on the Riff Blog - a method for correctly encoding PHP-GTK applications.
PHP scripts are typically stored under UTF-8 encoding to limit i18n headaches, while the console in which their output will be displayed is normally configured to some regional encoding, like IBM850 in Windows/XP French.
So we need a workaround...
He splits the process out into a few steps, each with its own explanation and code:
- Builtin tools
- Buffering
- Flushing
- PHP-GTK is not PHP for the Web
- Auto-flushing