|
pearl to create files with russian names
|
|
03-09-2010, 07:14 PM
Post: #1
|
|||
|
|||
|
pearl to create files with russian names
Hi all,
I'm trying to create files on a Windows XP machine that hold russian language content. The content is generated with perl scripts. The problem is that when I try to give the files meaningful russian names, the filenames come out garbled. For example: $u = "работать" ; $f = magic($u) ; # the magic function is what I am looking for... open O,">$f" ; the kind of magic I am trying results in filenames like работать.html I've tried using encode/decode functions, but I'm obviously not doing it right. thanks |
|||
|
03-09-2010, 07:23 PM
Post: #2
|
|||
|
|||
|
RE: pearl to create files with russian names
use Encode like this:
----------------------------------- use utf8; use Encode; $u = "работать"; $f = encode("cp1251", $u); open O, ">$f" or die "OMG!"; close O; ----------------------------------- or just save your source .pl file as ANSI text, it will create file without any additional charset conversions. |
|||
|
« Next Oldest | Next Newest »
|




