On Thu, 5 Aug 2004, Nick Ing-Simmons wrote: > >Alright, I failed to say that this is an XS module, so I convert with > >WideCharToMultiByte, a Windows routine(*), put the result in an SV, and > >then say SvUTF8_on. > > The possible danger here is if the "multi byte" encoding for > user's environment is not UTF-8 but (say) a Japanese one.
Almost always(99.999% of time. unless SetACP() or sth. is used to change it), the default system code page is not UTF-8 on Windows (Windows-1252 on Western European Windows, Windows-1251 on Russian, Windows-932/936/949/950 on East Asian windows, etc). However, you can specify the code page for 'multibyte' encoding to use when invoking WideCharToMultiByte (i.e. WideCharToMultiByte is different from wcstombs() on a POSIX system). See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/unicode_2bj9.asp Jungshik