Hallo Monks,

I 'm new to Perl and not be able to locate my problem exactly. I've searched but can't find the right solution.I hope here is a right place to post.

Env: Win2000(en) +ActivePerl 5.8+ Komodo

The trouble begins with special characters in German. I want to copy a whole directory to another location , a prototype got no problem with direct writing paths of source and destination in program:

1) define $srcdir in perl-program
$dstdir in perl-program
like this:

use File::Find; ... # there are directory d:\perl\source\test\öa and file d:\perl\source\ +test\öa\ü.txt under \test\ $srcdir="d:\\perl\\source\\test"; $dstdir="d:\\test2"; finddepth(\&check_and_copy, $srcdir); # sub check_and_copy check the time of file/dir and only copy the upd +ated file/dir to $dstdir
Then I wrote srcdir & dstdir in config.xml and use
XML:Simple to read and got them in UTF8 format but nothing is copied!
2) define $srcdir in xml
$dstdir in xml

Komodo shows that first $_ in "finddepth" is "d:\perl\source\test\öa" (ö in Hex)
There are someting not correct: it should be "d:\perl\source\test\öa\ü.txt" by depth first search( just like in 1) )
Then I run the Program under Dos, it shows a warning: "Can't cd to <d:\perl\source\test/> öa ..." (here ö can't display correctly")

--Is there something wrong in File::Find with utf8 or with utf8 under win2k? --Or it depends on somethings else?

I made some tests but I can't understand the results well.

3) define $srcdir in perl-program
$dstdir in xml
# the files is copied but the charater shows in Ascii format.

4) define $srcdir in perl-program and test

$srcdir="d:\\perl\\source\\test"; if(Encode::is_utf8($srcdir) ){ print " src is_utf8\n"; }else{ print " src is_NOT_utf8\n"; } # I got "src is_NOT_utf8", I heared Perl use UTF8 internal. but it se +ems that's not so simple.

5).define $srcdir with "ö" in perl-program and use utf8

use utf8; $srcdir="d:\\perl\\source\\test\\öa"; # I got "Malformed UTF-8 character (unexpected non-continuation byte 0 +x61, immediately after start byte 0xf6)"

--What 's the encoding of a Perl- program in Komodo?
--How can I got the encoding's name of a string?
--How can I got the right output for "ä, ö ,ü" in DOS? (I got correct character in Komodo with "binmode (STDOUT,"utf8");" )

Thanks for your attention!

In reply to Unicode (ä, ö, ü in German) Problem with File::Find under Windows2000 by TeddyC

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.