[Haskell-cafe] Unicode pretty-printing

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Sun Aug 29 12:42:18 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/29/10 07:35 , Ivan Lazar Miljenovic wrote:
> On 29 August 2010 21:24, Peter Gromov <gromopetr at gmail.com> wrote:
>> $ locale LANG= LC_COLLATE="C" LC_CTYPE="C" LC_MESSAGES="C" 
>> LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL=
>> 
>> Unfortunately, I'm completely lame with locales and googling doesn't 
>> help very much to change "C" to something like UTF-8 (Mac, Snow 
>> Leopard). But the terminal does support UTF-8 anyway, as the output 
>> from my previous message shows (the main function output).
> 
> No idea about dealing with Macs, sorry.

"export LC_ALL=en_US.UTF-8"
Terminal.app normally does this automatically; see Preferences > Settings,
Advanced tab for whatever terminal definition you are using.  At the bottom
of the pane, under "International", make sure "Set locale environment
variables on startup" is checked.

Another way to do it is to arrange for the Finder to launch with the locale
pre-set.  You want something like this:

mress:20011 Z$ plutil -convert xml1 -o - ~/.MacOSX/environment.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>LANG</key>
	<string>en_US.UTF-8</string>
	<key>LC_ALL</key>
	<string>en_US.UTF-8</string>
</dict>
</plist>

You'll have to log out and back in to activate it.  (Alternatively to
manipulating plists by hand, use something like
<URI:http://www.apple.com/downloads/macosx/system_disk_utilities/environmentvariablepreferencepane.html>
( http://preview.tinyurl.com/3ythrds ).)

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university      KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx6jeoACgkQIn7hlCsL25XDxwCguNj0ciIDtCOJJvXaCslhTlx0
PG4AoKF79lzQxNfFRQuJjiFdPGfIMzaZ
=GacS
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list