Re: Always setting UTF-8 flag - am I bad?

[email protected] (Jungshik Shin)
Newsgroups perl.unicode
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.