String encoding problems

Stephan Rose kermos at somrek.net
Mon Dec 3 01:17:17 PST 2007


Hi all,

how does everyone deal with string encodings? Here is a problem I'm
running into.

Currently I'm primarly using std::wstring in my project. Under linux,
wchar_t is 32-bit. Wonderful as it means that any character will fit
fully into one wchar_t.

So then the other day, I check out windows and realize windows does
16-bit for wchar_t. Now the above no longer holds true, nor does my file
IO code like this as it expects wchar_t to be 32-bit.

I suppose I can save / load via utf-8 but I still have the problem after
loading with my internal representation. Using wxString isn't really an
option in those areas as I'm trying to keep most of the affected code
api independent. 

Any thoughts / suggestions appreciated!

Thanks,

Stephan






More information about the wx-users mailing list