Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-18 Thread Mark J. Reed
On Mon, May 18, 2009 at 9:17 AM, Dave Korn wrote: > Lenik wrote: >> On 2009-5-18 14:09, Christopher Faylor wrote: >>> >>> I think the main person you should be thanking isn't a guy. >>> >> Ok. Thank you gods. >> > >  Hey Corinna?  Congrats!  You just got a promotion! All praise to the great Corin

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-18 Thread Dave Korn
Lenik wrote: > On 2009-5-18 14:09, Christopher Faylor wrote: >> >> I think the main person you should be thanking isn't a guy. >> > Ok. Thank you gods. > Hey Corinna? Congrats! You just got a promotion! cheers, DaveK -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-sim

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-18 Thread Lenik
On 2009-5-18 14:09, Christopher Faylor wrote: I think the main person you should be thanking isn't a guy. Ok. Thank you gods. Lenik -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-17 Thread Christopher Faylor
On Mon, May 18, 2009 at 01:41:28PM +0800, Lenik wrote: >The expr error is fixed, and I can build cygpath from source now. >Though I don't have NTDDK in hand, I'm suprised how it could be >compiled. The cygwin build is fairly self-contained. We certainly don't need anything like a DDK to build. >

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-17 Thread Lenik
On 2009-5-17 15:52, Lenik wrote: 2, configure failed: bash-3.2$ ./configure 5 [main] expr 952 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack) ./configure: line 56: 952 Segmentation fault (core dumped) expr a : '\(a\)' > /dev/null 2>&1 4 [main] expr 2808 _cygtls::h

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-17 Thread Lenik
On 2009-5-17 19:53, Corinna Vinschen wrote: On May 17 15:52, Lenik wrote: On 2009-5-17 10:09, IWAMURO Motonori wrote: 2009/5/17 Lenik: Thanks, but where can I get this patch? You can checkout it from CVS HEAD. [...] 6 weeks to the next release maybe too long to wait. We have about 2 weeks

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-17 Thread Corinna Vinschen
On May 17 15:52, Lenik wrote: > On 2009-5-17 10:09, IWAMURO Motonori wrote: >> 2009/5/17 Lenik: >>> Thanks, but where can I get this patch? >> >> You can checkout it from CVS HEAD. >[...] > 6 weeks to the next release maybe too long to wait. We have about 2 weeks between the test releases. Corin

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-17 Thread Corinna Vinschen
On May 17 11:09, IWAMURO Motonori wrote: > 2009/5/17 Lenik : > > Thanks, but where can I get this patch? > > You can checkout it from CVS HEAD. It occured to me that, if you're using a charset which differs from your current ANSI or OEM codepage, you might run into trouble with native Windows too

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-17 Thread Lenik
On 2009-5-17 10:09, IWAMURO Motonori wrote: 2009/5/17 Lenik: Thanks, but where can I get this patch? You can checkout it from CVS HEAD. Thanks for your information, well, I'm not expect to build from source, that really frustrates me, and brings me even more problems. Is there any mirror

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-16 Thread IWAMURO Motonori
2009/5/17 Lenik : > Thanks, but where can I get this patch? You can checkout it from CVS HEAD. -- IWAMURO Motnori -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/do

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-16 Thread Lenik
On 2009-5-16 23:49, Corinna Vinschen wrote: Looks like cygpath gets the wcstombs system call from ntdll rather than from cygwin1.dll due to a linking order problem. Unfortunately ntdll exports a couple of convenient C functions like wcstombs, or even sprintf. I applied a patch so the next versi

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-16 Thread Corinna Vinschen
On May 16 13:17, Lenik wrote: > (This mail is encoded in utf-8) > > After tested with 1.7.0-48, many problems are eliminated. > > But cygpath doesn't return good pathnames, see: Looks like cygpath gets the wcstombs system call from ntdll rather than from cygwin1.dll due to a linking order problem.

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-15 Thread Lenik
(This mail is encoded in utf-8) After tested with 1.7.0-48, many problems are eliminated. But cygpath doesn't return good pathnames, see: 1, Get absolute path of current directory: C:\Profiles\Shecti\桌面> set LANG=zh_CN.GBK& cygpath -am . C:/Profiles/Shecti/桌面 (good) C:\Profiles\Sh

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-15 Thread Corinna Vinschen
On May 15 20:34, IWAMURO Motonori wrote: > 2009/5/15 Corinna Vinschen : > > I have just trouble with SJIS, but that's not something I can easily > > test. Maybe you can look into that in the next couple of days? > > Maybe I can. Please explain details of the trouble. Probably I only fall over my

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-15 Thread IWAMURO Motonori
2009/5/15 Corinna Vinschen : > I have just trouble with SJIS, but that's not something I can easily > test. Maybe you can look into that in the next couple of days? Maybe I can. Please explain details of the trouble. -- IWAMURO Motnori -- Unsubscribe info: http://cygwin.com

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread Corinna Vinschen
On May 14 19:23, Corinna Vinschen wrote: > On May 15 01:34, IWAMURO Motonori wrote: > > 2009/5/15 Corinna Vinschen : > > > Here's one problem.  What if an application uses setenv("LANG", ...)? > > > > Oh. Hmmm, I think that anything should not occur. > > > > > Do you want Cygwin to intercept all

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread Corinna Vinschen
On May 15 01:34, IWAMURO Motonori wrote: > 2009/5/15 Corinna Vinschen : > > Here's one problem.  What if an application uses setenv("LANG", ...)? > > Oh. Hmmm, I think that anything should not occur. > > > Do you want Cygwin to intercept all calls to setenv() to check for > > setting $LC_ALL/LC_C

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread IWAMURO Motonori
2009/5/15 Corinna Vinschen : > Here's one problem.  What if an application uses setenv("LANG", ...)? Oh. Hmmm, I think that anything should not occur. > Do you want Cygwin to intercept all calls to setenv() to check for > setting $LC_ALL/LC_CTYPE/LANG? No. I think that only setlocale() has to do

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread Corinna Vinschen
On May 14 16:42, Corinna Vinschen wrote: > On May 14 23:06, IWAMURO Motonori wrote: > > 2009/5/14 Corinna Vinschen : > > > I see a couple of potential problems. > > > > What problems are those? > > I have no example off-hand. When I thought about it I always got sick > thinking about scenarios w

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread Corinna Vinschen
On May 14 23:06, IWAMURO Motonori wrote: > 2009/5/14 Corinna Vinschen : > > I see a couple of potential problems. > > What problems are those? I have no example off-hand. When I thought about it I always got sick thinking about scenarios where the library is using, say, UTF-8, and the applicatio

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread IWAMURO Motonori
2009/5/14 Corinna Vinschen : > I see a couple of potential problems. What problems are those? > And have some time to discuss whether these are something the > user can or even should fix or workaround alone. I think that the application that use locale by the environment variable and the applic

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread Corinna Vinschen
On May 14 21:39, IWAMURO Motonori wrote: > 2009/5/14 Corinna Vinschen : > >> > Should the following part not be modified? > >> > > >> > winsup/cygwin/fhandler_console.cc: > >> > > dev_state->con_mbtowc = __mbtowc; > >> > > dev_state->con_wctomb = __wctomb; > >> > >> I'd rather not.  It only affects

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread IWAMURO Motonori
2009/5/14 Corinna Vinschen : >> > Should the following part not be modified? >> > >> > winsup/cygwin/fhandler_console.cc: >> > > dev_state->con_mbtowc = __mbtowc; >> > > dev_state->con_wctomb = __wctomb; >> >> I'd rather not.  It only affects the console and if LANG=C I'd rather >> see the single b

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-14 Thread Corinna Vinschen
On May 13 23:49, Matthias Andree wrote: > Am 13.05.2009, 17:17 Uhr, schrieb Corinna Vinschen > : > >> I followed the suggestion to use UTF-8 for internal conversions when the >> locale is set to "C". This will also be used as default conversion when >> converting the Windows environment from UTF

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Matthias Andree
Am 13.05.2009, 17:17 Uhr, schrieb Corinna Vinschen : I followed the suggestion to use UTF-8 for internal conversions when the locale is set to "C". This will also be used as default conversion when converting the Windows environment from UTF-16 to multibyte, unless the environment contains a

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 13 21:46, Corinna Vinschen wrote: > On May 14 04:13, IWAMURO Motonori wrote: > > 2009/5/14 Corinna Vinschen : > > > I already wrote that patch, see > > > http://cygwin.com/ml/cygwin-cvs/2009-q2/msg00066.html > > > It seems to do what you are proposing. > > > > I read it and built cygwin1.dl

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 14 04:13, IWAMURO Motonori wrote: > 2009/5/14 Corinna Vinschen : > > I already wrote that patch, see > > http://cygwin.com/ml/cygwin-cvs/2009-q2/msg00066.html > > It seems to do what you are proposing. > > I read it and built cygwin1.dll. It seems to work correctly. > > Should the followin

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread IWAMURO Motonori
2009/5/14 Corinna Vinschen : > I already wrote that patch, see > http://cygwin.com/ml/cygwin-cvs/2009-q2/msg00066.html > It seems to do what you are proposing. I read it and built cygwin1.dll. It seems to work correctly. Should the following part not be modified? winsup/cygwin/fhandler_console.c

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 14 02:25, IWAMURO Motonori wrote: > 2009/5/14 Corinna Vinschen : > > That's basically how my patch works. > > Sorry, I can't parse this sentence because of my poor English parser... No worries. > Do you be writing the patch for this problem? I already wrote that patch, see http://cygwin.

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread IWAMURO Motonori
2009/5/14 Corinna Vinschen : > That's basically how my patch works. Sorry, I can't parse this sentence because of my poor English parser... Do you be writing the patch for this problem? > Btw., if you plan to write more and bigger patches for Cygwin, it would > be necessary to sign a copyright as

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 14 01:03, IWAMURO Motonori wrote: > Hi. > > My idea is as follows: > > 1) separate mbtowc/wctomb function entries to library usage and > system usage. (__mbtowc/__wctomb & __sys_mbtowc/__sys_wctomb) > > 2) If call setlocale(LC_CTYPE) by locale != "C", then lib == sys. > > 3) If call set

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Andy Koppe
> Not necessarily better, but here is a chart: > > Sys:  App:    function expects/returns > NULL: NULL:   UTF-8 > C/UA: NULL:   UTF-8 > NULL: C/UA:   UTF-8 > C/UA: C/UA:   UTF-8 > SPEC: NULL:   System Locale > SPEC: C/UA:   UTF-8 > NULL  SPEC:   Application Locale > C/UA: SPEC:   Application Locale

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread IWAMURO Motonori
Hi. My idea is as follows: 1) separate mbtowc/wctomb function entries to library usage and system usage. (__mbtowc/__wctomb & __sys_mbtowc/__sys_wctomb) 2) If call setlocale(LC_CTYPE) by locale != "C", then lib == sys. 3) If call setlocale(LC_CTYPE) by locale == "C", then sys is set by LC_ALL/

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 13 11:41, Jason Pyeron wrote: > Corinna Vinschen wrote on Wednesday, May 13, 2009 10:30: > > On May 12 19:37, Corinna Vinschen wrote: > >> On May 13 02:29, IWAMURO Motonori wrote: > >>> I propose that the filename encoding in C locale uses UTF-8 instead > >>> of SO/UTF-8. > >>> > >>> There

RE: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Jason Pyeron
Corinna Vinschen wrote on Wednesday, May 13, 2009 10:30: > On May 12 19:37, Corinna Vinschen wrote: >> On May 13 02:29, IWAMURO Motonori wrote: >>> I propose that the filename encoding in C locale uses UTF-8 instead >>> of SO/UTF-8. >>> >>> There are three reasons: >> >> That's an interesting th

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 13 15:54, Andy Koppe wrote: > > - why do you need to touch the filename at all? I haven't read all of it. Is > > the UTF-16 on disk and we need to work around UTF-16 being intractable as C > > string? > > Yes. If you simply treated each UTF-16 symbol as two chars, you'd get > unintended NUL

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Andy Koppe
> - why do you need to touch the filename at all? I haven't read all of it. Is > the UTF-16 on disk and we need to work around UTF-16 being intractable as C > string? Yes. If you simply treated each UTF-16 symbol as two chars, you'd get unintended NULs and slashes. For starters, the upper halves o

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Matthias Andree
Am 13.05.2009, 16:29 Uhr, schrieb Corinna Vinschen : On May 12 19:37, Corinna Vinschen wrote: On May 13 02:29, IWAMURO Motonori wrote: > I propose that the filename encoding in C locale uses UTF-8 instead of SO/UTF-8. > > There are three reasons: That's an interesting thought. Do you hav

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Corinna Vinschen
On May 12 19:37, Corinna Vinschen wrote: > On May 13 02:29, IWAMURO Motonori wrote: > > I propose that the filename encoding in C locale uses UTF-8 instead of > > SO/UTF-8. > > > > There are three reasons: > > That's an interesting thought. Do you have a patch and, if so, did you > try it? Doe

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-13 Thread Lenik
http://cygwin.com/ml/cygwin/2009-05/msg00245.html? I found this web page doesn't display utf-8 characters correctly. BTW, I'm using thunderbird as news reader. Lenik -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Docu

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-12 Thread Corinna Vinschen
On May 12 15:53, Mark J. Reed wrote: > On Tue, May 12, 2009 at 3:22 PM, Corinna Vinschen > > > > http://cygwin.com/1.7/cygwin-ug-net/using-specialnames.html#pathnames-unusual > > OK, got it. So Mr. Iwamuro's proposal is that Cygwin ignore the > locale setting, and just automatically convert the W

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-12 Thread Mark J. Reed
On Tue, May 12, 2009 at 3:22 PM, Corinna Vinschen > > http://cygwin.com/1.7/cygwin-ug-net/using-specialnames.html#pathnames-unusual OK, got it. So Mr. Iwamuro's proposal is that Cygwin ignore the locale setting, and just automatically convert the Windows UTF-16 filenames to UTF-8 (and back) no ma

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-12 Thread Corinna Vinschen
On May 12 15:13, Mark J. Reed wrote: > > On May 13 02:29, IWAMURO Motonori wrote: > >> Hi. > >> > >> I propose that the filename encoding in C locale uses UTF-8 instead of > >> SO/UTF-8 > > What the heck is "SO/UTF-8"? http://cygwin.com/1.7/cygwin-ug-net/using-specialnames.html#pathnames-unusual

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-12 Thread Mark J. Reed
> On May 13 02:29, IWAMURO Motonori wrote: >> Hi. >> >> I propose that the filename encoding in C locale uses UTF-8 instead of >> SO/UTF-8 What the heck is "SO/UTF-8"? -- Mark J. Reed -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/p

Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-12 Thread Corinna Vinschen
On May 13 02:29, IWAMURO Motonori wrote: > Hi. > > I propose that the filename encoding in C locale uses UTF-8 instead of > SO/UTF-8. > > There are three reasons: > > 1. for the interoperability between Cygwin and various UNIX-like > systems (Linux, *BSD, Solaris, and so on). >UNIX-like sys

[1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

2009-05-12 Thread IWAMURO Motonori
Hi. I propose that the filename encoding in C locale uses UTF-8 instead of SO/UTF-8. There are three reasons: 1. for the interoperability between Cygwin and various UNIX-like systems (Linux, *BSD, Solaris, and so on). UNIX-like systems treat the filename as 8bit byte array, and many applicati