What is the correct way to set Python’s locale on Windows?

It seems you’re using Windows. The locale strings are different there. Take a more precise look at the doc: locale.setlocale(locale.LC_ALL, ‘de_DE’) # use German locale; name might vary with platform On Windows, I think it would be something like: locale.setlocale(locale.LC_ALL, ‘deu_deu’) MSDN has a list of language strings and of country/region strings

Labeling file upload button

It is normally provided by the browser and hard to change, so the only way around it will be a CSS/JavaScript hack, See the following links for some approaches: http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom http://www.quirksmode.org/dom/inputfile.html http://www.dreamincode.net/forums/showtopic15621.htm

JavaFX 2 and Internationalization

The basic steps (among others) of a java app internationalizing, are Localelizing and resource bundling. In JavaFX, you can use FXMLLoader#setResources() for that purposes. Here a SSCCE demo to demonstrate it. The codes are self-descriptive. Demo package structure: bundledemo |—— BundleDemo.java |—— MyController.java |—— MyView.fxml bundles |—— MyBundle_en.properties |—— MyBundle_kg.properties MyBundle_en.properties key1=Name Surname key2=How are … Read more

Whether to use “SET NAMES”

mysql_set_charset() would be an option – but an option limited to the ext/mysql. For ext/mysqli it is mysqli_set_charset and for PDO::mysql you need to specify a connection parameter. As using this function results in a MySQL API call, it should be considered much faster than issuing a query. In respect of performance the fastest way … Read more

What’s “wrong” with C++ wchar_t and wstrings? What are some alternatives to wide characters?

What is wchar_t? wchar_t is defined such that any locale’s char encoding can be converted to a wchar_t representation where every wchar_t represents exactly one codepoint: Type wchar_t is a distinct type whose values can represent distinct codes for all members of the largest extended character set specified among the supported locales (22.3.1).                                                                                — C++ … Read more

Localization in JSF, how to remember selected locale per session instead of per request/view

You need to store the selected locale in the session scope and set it in the viewroot in two places: once by UIViewRoot#setLocale() immediately after changing the locale (which changes the locale of the current viewroot and thus get reflected in the postback; this part is not necessary when you perform a redirect afterwards) and … Read more

How do I sort unicode strings alphabetically in Python?

IBM’s ICU library does that (and a lot more). It has Python bindings: PyICU. Update: The core difference in sorting between ICU and locale.strcoll is that ICU uses the full Unicode Collation Algorithm while strcoll uses ISO 14651. The differences between those two algorithms are briefly summarized here: http://unicode.org/faq/collation.html#13. These are rather exotic special cases, … Read more