Subject: Re: Unable to open files including Korean names
From: Jaeho Shin <[email-masked]>
To: "Pierre A. Humblet" <[email-masked]>
Cc: [email-masked]
Date: Mon, 14 Jun 2004 20:12:57 +0900

On Sun, Jun 13, 2004 at 02:55:23PM -0400, Pierre A. Humblet ([email-masked]) wrote:
> At 12:02 AM 6/14/2004 +0900, Jaeho Shin wrote:
> >On Sun, Jun 13, 2004 at 03:30:00AM +0900, Jaeho Shin
> >
> >- Simplify and speed up path handling. (Pierre Humblet)
> >
> >Perhaps it was TOO simplified? :-(
> >I'll try examining the codes as soon as I get some free time.
> >Or, maybe Pierre can fix the problem?
> 
> Do you see anything resembling what's described in
> http://cygwin.com/ml/cygwin/2004-05/msg00659.html
>  
> What character representation are you using? Is a character represented
> by one or by two (or more) bytes?
>  

Most people use Korean in EUC-KR or CP949(or UHC?) encodings.  They both
use two bytes representation.  Actually, CP949 is a Microsoft extension
of EUC-KR, so we can consider as the same in this situation.  I don't
know much about Shift-JIS, but since all Korean character bytes have
their high-bit(0x80) set, no byte will coincide with \ or /.  I'm not
sure what Windows does with path encoding in their filesystems, but
at least cygwin ``mount'' needs to know the encodings to solve such
Shift-JIS problems, perhaps?

> Your original mail stated
> "I did some test and found out that ``every file whose path includes
> Korean characters weren't openable.''  Still, I could move arround those
> paths from my shell, and get the file/directory listings with "ls"
> normally. I could still create directories with Korean names. "
> 
> That would indicate that it's not the path handling code, but the use
> of NtCreateFile in 1.5.10. 
> Can you "ls -l" those paths?

Sorry about my complaints against you.  I misunderstood ``path
handling'' as everything done when openning files with paths in Cygwin.
Yes, I can "ls -l" them, so the problem is really in the file openning
part, not the path handling. :)

> 
> Can you run some very simple program demonstrating the problem under
> strace, something like
> strace -o strace-10.txt touch "some short Korean path"
> both under 1.5.10 and 1.5.9?

Sure.  strace-{10,9}.txt are attached, and strace-env.txt, too.
It's the output of ``env'' where I ran strace.

The output looks like Cygwin is trying to make use of some locale files
which isn't there.  Well, Cygwin is already trying to handle encodings,
right?  Is it my installation problem?  Haven't I installed some locale
packages?

Oh, almost forgot.  I found out that I could also remove(rm) files
normally.  I discovered this when I removed the "한글.txt" file I
created in 1.5.9 before I ran strace in 1.5.10.  The problem should be
in the file openning part indeed.

P.S. The message was bounced due to size limit, so I had to gzip
strace-10.txt. :(

-- 
신재호 | Jaeho Shin <[email-masked]> | http://netj.org/
System Programmers' Association for Researching Computer Systems
Division of Computer Science, Department of EECS, KAIST