Unicode conversion


#1

Jules,

for char to wchar conversion you are using “mbstowcs”, and this uses system Locale for the conversion

How can I specify a differnet Locale for the conversion

And of course for the reverse function, “wcstombs”


#2

I guess you could set the locale using the c runtime library functions… it’s not something I’ve ever tried to do, TBH.


#3

I don’t want to change the system locale, I just have to specify the charset of the ascii string so the conversion will be done with a different locale.

I know MultiByteToWideChar Win32 API does this but I would prefer to do it multi-platform.


#4

Yeah, that’s the sort of thing that I should add to the string class, but haven’t got round to it yet… In the meantime it’s probably only a couple of lines of code to do yourself.


#5

Thanks,

I can do my conversion till your cross-platform is ready.


#6