Re: Converting codepages to UTF8
- From: "P" <szpara_ga@xxxxxxx>
- Date: 30 Mar 2006 10:01:12 -0800
Dr.Ruud wrote:
P schreef:
Is there a Perl module which implements converting of
codepages (such as you get when running "chcp" in a
command prompt) to UTF8? Something that allows me to
specify, for example, codepage 437 and then converting
it to UTF8. I've looked through the documentation for
the module Encode, but it doesn't seem to deal with
codepages at all.
chcp is a command to change the parameters of the display.
C:\>chcp /? Displays or sets the active code page number.
CHCP [nnn]
nnn Specifies a code page number.
Type CHCP without a parameter to display the active code
page number.
Yes, if you call chcp without a parameter you can establish
the code page. That information is necessary to know what
I'm converting from.
What do you want to do? If you want to convert a file from
one encoding to another, look for 'iconv'.
That's not exactly what I want to do. I have one file, which
is in UTF8, which contains a set of strings. I want to
determine whether any of the strings matches any file name
in a specified directory. Since there can be special
characters in the file names (and in the strings in the UTF8
file), sometimes I'll get false negatives, because a simple
eq on the strings in the UTF8 file and on the file names in
the directory won't match (due to the different encodings).
So I want to normalise the directory listing first (and this
should be dependent on the code page, because different
users might be using different code pages) and compare the
resulting list to the list in the UTF8 file. Does that make
sense? :)
Thank you for your input.
--
Best regards,
Angela Druss
.
- Follow-Ups:
- Re: Converting codepages to UTF8
- From: Dr.Ruud
- Re: Converting codepages to UTF8
- References:
- Converting codepages to UTF8
- From: P
- Re: Converting codepages to UTF8
- From: Dr.Ruud
- Converting codepages to UTF8
- Prev by Date: Windows Hooking
- Next by Date: Re: perl deparse question.
- Previous by thread: Re: Converting codepages to UTF8
- Next by thread: Re: Converting codepages to UTF8
- Index(es):
Relevant Pages
|