[darcs-users] darcs patch: Remove home-grown UTF-8 decoder, use utf... (and 1 more)

Reinier Lamers tux_rocker at reinier.de
Sun Sep 6 16:54:42 UTC 2009


On Sunday 06 September 2009 15:28:11 you wrote:
> I'm not sure, but I'd guess that the "locale" command is not available at
> least on Windows, but its manpage doesn't mention it being part of POSIX
> and instead says it was written for glibc, which may be a further
> portability problem. I'd suggest doing a

Good point.

> if which locale; then
>    latin9_locale=latin9_locale=`locale -a | grep @euro | head -n 1`
> else
>    latin9_locale=en_US.ISO-8859-1
> fi
> or if it is really required, exit 200 in the else branch.

At least my Ubuntu doesn't actually use a locale it doesn't recognize. So when 
you just set your LC_ALL to say that you want latin1, but you have not enabled 
the latin1 locale you specified, it will use the C locale. That's the problem 
I tackled with the 'locale -a | grep' stuff. If we exit 200 in the else 
branch, we may be effectively testing this on Linux only, which is not good 

Maybe locale-switching is inherently unportable and we have to settle for 
testing this only on Linux. But maybe our Unix guru Trent knows a way out?


PS: Petr: I accidentally sent this only to you first, I'm sorry :-(

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090906/d04df0d7/attachment.pgp>

More information about the darcs-users mailing list