Re: builtin printf behaves incorrectly with "c and 'c character-value arguments

2007-11-05 Thread Chet Ramey
Rich Felker wrote: > $ printf %d\\n \'À > -61 > (expected 192) > > This should be 192 regardless of locale on any system where wchar_t > values are ISO-10646/Unicode. Bash is incorrectly reading the first > byte of the UTF-8 which happens to be -61 when interpreted as signed > char; on a Latin-1 b

Re: try to open file descriptor for input with 'exec' fails

2007-11-05 Thread Chet Ramey
[EMAIL PROTECTED] wrote: > Bash Version: 3.2 > Patch Level: 25 > Release Status: release > > Description: > In the following script i try to open a free file > descriptor for input from a file. > The script should read lines out of a textfile, > output goes to stdout. > This works fine till my

Re: builtin printf behaves incorrectly with "c and 'c character-value arguments

2007-11-05 Thread Rich Felker
On Mon, Nov 05, 2007 at 09:10:29AM -0500, Chet Ramey wrote: > Rich Felker wrote: > > $ printf %d\\n \'À > > -61 > > (expected 192) > > > > This should be 192 regardless of locale on any system where wchar_t > > values are ISO-10646/Unicode. Bash is incorrectly reading the first > > byte of the UTF

Re: builtin printf behaves incorrectly with "c and 'c character-value arguments

2007-11-05 Thread Chet Ramey
Rich Felker wrote: > I'm not sure what you mean. For a Latin-1 locale there is no > difference, but if the locale is a different legacy locale, the > wchar_t value (Unicode scalar value on systems with __STDC_ISO_10646__ > defined) needs to be returned. If you're doubtful about the intent of > the

Re: builtin printf behaves incorrectly with "c and 'c character-value arguments

2007-11-05 Thread Rich Felker
On Mon, Nov 05, 2007 at 10:23:43PM -0500, Chet Ramey wrote: > Rich Felker wrote: > > > I'm not sure what you mean. For a Latin-1 locale there is no > > difference, but if the locale is a different legacy locale, the > > wchar_t value (Unicode scalar value on systems with __STDC_ISO_10646__ > > def