perl-unicode

Re: Converting between UTF8 and local codepage without specifying local codepage

2005-11-09 08:11:26
On Wed, Nov 09, 2005 at 10:02:31AM -0500, David Schlegel wrote:
That is helpful information. I have been spending time to determine the 
local page by other means but have consistently been challenged that this 
is the wrong approach and that Perl must know somehow. Getting a 
definitive answer is almost as helpful as getting a better answer. 

Based on what you are saying, there is no way to ask Perl what the "local 
codepage" is and hence there can be no variant of "Encode" which can be 
told to convert from "local codepage" to UTF8 without having to provide 
the "local codepage" value explicitly. 

Yes. A good summary of the situation.

Is I18N::Langinfo(CODESET())  the best way to determine the local codepage 
for Unix ? Windows seems to reliably include the codepage number in the 
locale but Unix is all over the map.

I don't know. I have little to no experience of doing conversion of real
data, certainly for data outside of ISO-8859-1 and UTF-8, and I've never used
I18N::Langinfo. I hope that someone else on this list can give a decent
answer.

Nicholas Clark