in reply to XML converts to UTF-8 and causes problems for non-English language speakers

If you want to use non-ASCII characters in your Perl source code (eg: in identifier names or comments) and 'use utf8' (not use utf) then you need to configure your editor to save the file using utf8 encoding. With 'vim', this is the relevant option:

:set encoding=utf-8

The problem with the 8 bit codes (ISO-8859-1, CP1252, etc) is that most file formats other than XML don't allow you to specify which 8 bit code you've used. In theory if we all switch to utf and stop using 8 bit codes life will be easier although expect pain during the switch.

If you don't say 'use utf8' in Perl, then it won't complain about non-ASCII characters in your source code, but it won't let you use them everywhere you might want. If you do say 'use utf8', then it will all work, as long as your source file actually is utf8 (ala the vim option above).

  • Comment on Re: XML converts to UTF-8 and causes problems for non-English language speakers
  • Download Code