Hi David,

On 21 September 2011 16:49, David Virebayre <dav.vire+haskell@gmail.com> wrote:
Bonjour,

I'm posting this hoping that someone has seen the same problem; if
nobody has, I'll make an example program, post the source and give
screenshots.

I have a program that works fine on linux.

I followed the instructions to install wxhaskell on windows, all went
fine. it's with wxWidgets 2.8.10.

I compiled the source on windows, and when I run the program, all the
strings are reduced to the first character: Labels in buttons, text
fields, name of the app's icon (which fire an error because the icon
doesn't exist) etc...

Anyone has seen this before ?

This sounds like a Unicode problem.

On Windows, strings are natively encoded in UTF16, which uses two bytes to represent a character. In the common case (for Western European languages), most characters have the upper byte set to zero (as the codes used are backwards compatible with ASCII).

Now, older wxWidgets (anything < wxWidgets 2.9) can be built as Unicode (where Strings are represented as wchar_t *) or ASCII (where strings are a C char*) - a feature to enable wxWidgets to wrap older code which believes that only Western European languages should be able to be expressed ;-)

I would start by checking the wxWidgets libraries you are linking. If you have wxmswu<something> then it's Unicode - otherwise it is ASCII.

Because of the coding, the ASCII wxWidgets libraries see the '0' as the upper byte of a Unicode string as a string terminator.

Regards
Jeremy