Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Create a chinese directory (folder) by Perl in Windows 2000 English OS

Reply
Thread Tools

Create a chinese directory (folder) by Perl in Windows 2000 English OS

 
 
gaolixin
Guest
Posts: n/a
 
      09-21-2004
I am a perl newbie, and I am trying to use a perl program to create a
folder in Window2000. My WINDOWS 2000 is English OS, but setup using
Chinese (PRC) as default locale. I am able to create chinese folders
manually, and able to view them.

The perl program has a statment like

use strict; $|++;
my $VERSION = "1.0";
use File::Spec::Functions;
....
mkdir $dirpath;

where $dirpath has chinese chars inside using GB2312 encoding. It
created a folder but the chinese not readiable .

Can anybody help me through, can you give me a sample program? Thanks
a lot!!!

Thanks, Lixin
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      09-21-2004
gaolixin wrote:
> I am a perl newbie, and I am trying to use a perl program to create a
> folder in Window2000. My WINDOWS 2000 is English OS, but setup using
> Chinese (PRC) as default locale. I am able to create chinese folders
> manually, and able to view them.
>
> The perl program has a statment like
>
> use strict; $|++;
> my $VERSION = "1.0";
> use File::Spec::Functions;
> ...
> mkdir $dirpath;
>
> where $dirpath has chinese chars inside using GB2312 encoding. It
> created a folder but the chinese not readiable .


You may want to try using UTF-16 instead of GB2312 because internally Win2k
is based on Unicode.

jue


 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      09-22-2004

Quoth http://www.velocityreviews.com/forums/(E-Mail Removed) (gaolixin):
> I am a perl newbie, and I am trying to use a perl program to create a
> folder in Window2000. My WINDOWS 2000 is English OS, but setup using
> Chinese (PRC) as default locale. I am able to create chinese folders
> manually, and able to view them.
>
> The perl program has a statment like
>
> use strict; $|++;
> my $VERSION = "1.0";
> use File::Spec::Functions;
> ...
> mkdir $dirpath;
>
> where $dirpath has chinese chars inside using GB2312 encoding. It
> created a folder but the chinese not readiable .
>
> Can anybody help me through, can you give me a sample program? Thanks
> a lot!!!


Use the Encode module to convert the path into UTF16, which is what M$ use
for international stuff. (completely untested)

Ben

--
"If a book is worth reading when you are six, * (E-Mail Removed)
it is worth reading when you are sixty." - C.S.Lewis
 
Reply With Quote
 
Mihai N.
Guest
Posts: n/a
 
      09-24-2004
>> I am a perl newbie, and I am trying to use a perl program to create a
>> folder in Window2000. My WINDOWS 2000 is English OS, but setup using
>> Chinese (PRC) as default locale. I am able to create chinese folders
>> manually, and able to view them.

If you have the default system locale set to Chinese, it should work.
From "Control Panel" open "Regional Options", "General" tab, then
"Set Default" (button, left-bottom), select "Chinese (PRC)", "Ok", reboot.
User locale is not enough.

> Use the Encode module to convert the path into UTF16, which is what M$ use
> for international stuff. (completely untested)

Unlikely. Perl.exe is not a Unicode application.

--
Mihai
-------------------------
Replace _year_ with _ to get the real email
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to make English-speaking friend to practic my poor English IchBin Java 1 03-26-2006 05:36 AM
English/English DLL =?Utf-8?B?UmFlZCBTYXdhbGhh?= ASP .Net 2 10-16-2005 10:32 AM
Calender control, how to display week days as English even windows region is Chinese? Jack ASP .Net 2 10-12-2005 01:28 AM
Dictionaries for English-French and English-Spanish fkissam Computer Support 2 07-14-2004 09:07 PM
AMERICAN ENGLISH vs BRITISH, CANADIAN, or AUSTRALIAN ENGLISH Proud USA Babe Digital Photography 247 10-07-2003 12:32 AM



Advertisments