Skip to content

How Mono gets its CultureInfo

by Cory Foy on June 20th, 2006

Recently, we had a core NUnit test failing on Mono/Linux. It was expecting the CultureInfo to be set to a certain pattern of string (xx-XX, or [a-z][a-z]-[A-Z][A-Z]), but when I ran it, it was coming back blank.

Since CultureInfo is something that is usually read from the underlying OS, I inquired on the Mono list about it. It turns out that Mono checks two environment variables – LANG and LC_ALL. So in order to get Mono to see your language culture – do:

foyc@dilbert $ LANG=en_US
foyc@dilbert $ EXPORT LANG
foyc@dilvert $ echo $LANG
en_US

From → Uncategorized

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS