Skip to content

Cory Foy

Organizational agility through intersecting business and technology

Menu
  • FASTER Fridays
  • Mapping Mondays
  • Player Embed
  • Search Videos
  • User Dashboard
  • User Videos
  • Video Category
  • Video Form
  • Video Tag
Menu

How Mono gets its CultureInfo

Posted on June 20, 2006 by Cory Foy

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

© 2025 Cory Foy | Powered by Superbs Personal Blog theme