On Thu, May 31, 2012 at 2:14 PM, Lanny Ripple <[email protected]> wrote:
>  lanny;~> echo "Rémi Leblond" | LANG=C LC_ALL=C /sw/bin/sed -ne 
> 's/.*/GIT_AUTHOR_NAME='\''&'\''/p'
>  GIT_AUTHOR_NAME='R'émi Leblond

Ahh ha! I've found it! Here's what's happening:

After looking at the sed code a long time, I inserted some printf
statements in sed/libs/localcharset.c:locale_charset. Here's the
output:

$ echo "Rémi Leblond" | LANG=C LC_ALL=C ./sed -ne
's/.*/GIT_AUTHOR_NAME='\''&'\''/p'
codeset nl_langinfo = US-ASCII
codeset pre alias = US-ASCII
codeset post alias = UTF-8
codeset_name = UTF-8
codeset nl_langinfo = US-ASCII
codeset pre alias = US-ASCII
codeset post alias = UTF-8
GIT_AUTHOR_NAME='R'émi Leblond

The problem is how this gets aliases to UTF-8. On Lion, looking at
/usr/lib/charset.alias we see:

# This file contains a table of character encoding aliases,
# suitable for operating system 'darwin10.0'.
# It was automatically generated from config.charset.
# Packages using this file:
* UTF-8

Argg. Now sed thinks that the charset is UTF-8, yet MB_CUR_MAX returns
1 which breaks the regular expression engine. If you set
CHARSETALIASDIR to something sane:

$ export CHARSETALIASDIR=/sw/etc/glib-2.0/charset.alias
$ echo "Rémi Leblond" | LANG=C LC_ALL=C ./sed -ne
's/.*/GIT_AUTHOR_NAME='\''&'\''/p'
codeset pre alias = C
codeset post alias = C
codeset_name = C
codeset pre alias = C
codeset post alias = C
GIT_AUTHOR_NAME='Rémi Leblond'

So... this is IMHO an obviously broken setup by Apple. Can Fink fix
it? I don't think so. You could fix it yourself by adding the
CHARSETALIASDIR to your .profile/.bashrc and setting it to something
sane.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fink-users mailing list
[email protected]
List archive:
http://news.gmane.org/gmane.os.macosx.fink.user
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to