What is 'Locale'?

Locale settings in a program are used to set default values of certain parameters relating to the region where the program is used. This can be the currency of the region, the language, the language encoding etc.

Locales in Python

In Python, locales are supported by using the locale module. This is loosely based upon the locale functions provided by ANSI C inside the "locale.h" header file. The Python locale module provides a lot of default locales pertaining to different regions such as american, russian, spanish, swedish, chinese, arabic etc.

Locales in HarvestMan
In HarvestMan, the patch 001P391 provides locale behavior. The default locale is set to american with a en_US.ISO8859-1 encoding. You can set your own locale in the HarvestMan configuration file (config.txt) by using the system.locale variable. The following are common locale settings. (not in alphabetical order).


Country               system.locale value

Russia                russian
Denmark               danish
Sweden                swedish
Gulf(Arabic)          arabic
China                 chinese-s
Taiwan                chinese-t
Croatia               croatian
France                french, french_france
Germany               german
Greece                greek
Hungary               hungarian
Italy                 italian
Japan                 japan, japanese
Korea                 korean
Poland                polish
Portugal              portuguese
Rumania               rumanian
Spain                 spanish
Turkey                turkish

If these settings don't work, you can try the 'universal' locale. The default setting is 'american' which uses an european iso8859 string and regular expression encoding. If you want a neutral locale, use the 'C' locale whose string is 'posix'.

Most of the time the default HarvestMan locale setting of 'american' should work. Change the locales only if you find that there are some errors in web page parsing which causes a HarvestMan project to complete prematurely without downloading a lot of files.