Re: [PATCH] fix locale string reading

2011-11-15 Thread Ludovic Courtès
Hi Mark! Mark H Weaver skribis: > l...@gnu.org (Ludovic Courtès) writes: >>> I think we should consider decoding the command-line arguments using the >>> locale specified by the environment variables, at least in cases like >>> this where there's no way for the user to call setlocale before the

Re: [PATCH] fix locale string reading

2011-11-14 Thread Mark H Weaver
Hi Ludovic! l...@gnu.org (Ludovic Courtès) writes: >> I think we should consider decoding the command-line arguments using the >> locale specified by the environment variables, at least in cases like >> this where there's no way for the user to call setlocale before the >> conversion happens. > >

Re: [PATCH] fix locale string reading

2011-11-14 Thread Ludovic Courtès
Hi Mark, Mark H Weaver skribis: > l...@gnu.org (Ludovic Courtès) writes: >> Nala Ginrut skribis: >>> + setlocale (LC_ALL, ""); >> >> Currently, like in C, it’s the programmer’s responsibility to install >> the locale with such a call, and none of Guile’s business. > > Unfortunately, I don't se

Re: [PATCH] fix locale string reading

2011-11-11 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes: > Nala Ginrut skribis: >> + setlocale (LC_ALL, ""); > > Currently, like in C, it’s the programmer’s responsibility to install > the locale with such a call, and none of Guile’s business. Unfortunately, I don't see a way for the user to call setlocale before

Re: [PATCH] fix locale string reading

2011-11-11 Thread Ludovic Courtès
Hi, Nala Ginrut skribis: > + setlocale (LC_ALL, ""); Currently, like in C, it’s the programmer’s responsibility to install the locale with such a call, and none of Guile’s business. Thanks, Ludo’.

Re: [PATCH] fix locale string reading

2011-11-09 Thread Nala Ginrut
On Wed, Nov 9, 2011 at 9:45 PM, Peter Brett wrote: > Nala Ginrut writes: > > > This couldn't be the final solution. > > Even we add a (command-line-bv), it may cause encoding-error. Because > > (command-line) would read argv too , and raise the error. > > Unless we use (command-line-bv) and dele

Re: [PATCH] fix locale string reading

2011-11-09 Thread Peter Brett
Nala Ginrut writes: > This couldn't be the final solution. > Even we add a (command-line-bv), it may cause encoding-error. Because > (command-line) would read argv too , and raise the error. > Unless we use (command-line-bv) and delete (command-line). (command-line-bv) should never cause an "enc

Re: [PATCH] fix locale string reading

2011-11-09 Thread Nala Ginrut
On Wed, Nov 9, 2011 at 6:20 PM, Peter Brett wrote: > Nala Ginrut writes: > > > But Guile will break in (command-line) proc, because Chinese string as > > command arguments can not get valid result from > > "u32_conv_from_encoding" called by "scm_from_stringn", and raised an > > error. > > Proba

Re: [PATCH] fix locale string reading

2011-11-09 Thread Peter Brett
Nala Ginrut writes: > But Guile will break in (command-line) proc, because Chinese string as > command arguments can not get valid result from >  "u32_conv_from_encoding" called by "scm_from_stringn", and raised an > error.  Probably what should happen is that Guile's command-line parsing code s

Re: [PATCH] fix locale string reading

2011-11-08 Thread Nala Ginrut
Well, I've read the manual about scm_*_locale_string. It shows: --- Note that these functions should not be used to convert C string constants, because there is no guarantee that the current locale will match that of the source code. To convert C string constants, us

Re: [PATCH] fix locale string reading

2011-11-08 Thread Nala Ginrut
Sorry, it's my fault. setlocale(LC_ALL,"") is not query. setlocale(LC_ALL,NULL) does. So it's a wrong patch. Thanks Petter.

Re: [PATCH] fix locale string reading

2011-11-08 Thread Nala Ginrut
On Tue, Nov 8, 2011 at 9:31 PM, Peter Brett wrote: > Nala Ginrut writes: > > > Here is the patch. It solved the problem like these: > > @@ -1532,6 +1533,7 @@ scm_from_locale_string (const char *str) > > SCM > > scm_from_locale_stringn (const char *str, size_t len) > > { > > + setlocale (LC_A

Re: [PATCH] fix locale string reading

2011-11-08 Thread Peter Brett
Nala Ginrut writes: > Here is the patch. It solved the problem like these: > @@ -1532,6 +1533,7 @@ scm_from_locale_string (const char *str) >  SCM >  scm_from_locale_stringn (const char *str, size_t len) >  { > +  setlocale (LC_ALL, ""); >    return scm_from_stringn (str, len, locale_charset (),