locale

Get dates from AUT?

自作多情 提交于 2019-12-30 11:48:48
问题 My Web-based application (like most) follows the browser locale to format dates. So if you configure British English as the preferred language in the browser, the app will display dates in " DD/MM/YYYY " format. Now QTP (ok, it´s VBScript that is the culprit) does not know about this. It strictly follows the local machine´s locale settings. Unfortunately, that means that if my local machine is configured to German locale, and the app is in English (because the browser is configured this way),

convert unicode to char

情到浓时终转凉″ 提交于 2019-12-30 11:33:10
问题 How can I convert a Unicode string to a char* or char* const in embarcadero c++ ? 回答1: "Unicode string" really isn't specific enough to know what your source data is, but you probably mean 'UTF-16 string stored as wchar_t array' since that's what most people who don't know the correct terminology use. "char*" also isn't enough to know what you want to target, although maybe "embarcadero" has some convention. I'll just assume you want UTF-8 data unless you mention otherwise. Also I'll limit my

Why is jstl's formatNumber currency symbol locale specific when setting currencyCode

与世无争的帅哥 提交于 2019-12-30 10:59:47
问题 I'm using formatNumber as follows: <fmt:formatNumber value="${amount}" type="currency" currencyCode="${currencyCode}" var="amt" /> If I'm in locale en_US and the currency code is EUR I get EUR as the symbol, but if I'm in locale en_GB I get € . Why is the locale taken into account? Shouldn't EUR always convert into € ? Is there anyway to get the behavior I'm expecting using formatNumber ? 回答1: Locale is taken into acount so the output makes sense to the user. As a silly American (who lives in

Why is jstl's formatNumber currency symbol locale specific when setting currencyCode

时光毁灭记忆、已成空白 提交于 2019-12-30 10:59:12
问题 I'm using formatNumber as follows: <fmt:formatNumber value="${amount}" type="currency" currencyCode="${currencyCode}" var="amt" /> If I'm in locale en_US and the currency code is EUR I get EUR as the symbol, but if I'm in locale en_GB I get € . Why is the locale taken into account? Shouldn't EUR always convert into € ? Is there anyway to get the behavior I'm expecting using formatNumber ? 回答1: Locale is taken into acount so the output makes sense to the user. As a silly American (who lives in

speak with TTS such as Hindi

早过忘川 提交于 2019-12-30 06:32:50
问题 In my application , I wish to know if there is any tts engine that can read hindi text . my code tts.setLanguage(Locale.US); unfortunately Hindi is not supported by Android. See the list of Locales supported below http://developer.android.com/reference/java/util/Locale.html How will i do the hindi locale any help ? Thanks in advance 回答1: Hindi is supported by Android -- it is just that there isn't a Locale constant for it. If you look at http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes,

Using weekdays with any locale under Windows

心不动则不痛 提交于 2019-12-30 06:12:55
问题 I'm trying to get the day of the week, and have it work consistently in any locale. In locales with Latin alphabets, everything is fine. Sys.getlocale() ## [1] "LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252" weekdays(Sys.Date()) ## [1] "Tuesday" I have two related problems with other locales. If I set Sys.setlocale("LC_ALL", "Arabic_Qatar") ## [1] "LC_COLLATE=Arabic_Qatar

Shift-JIS decoding fails using wifstrem in Visual C++ 2013

可紊 提交于 2019-12-30 05:05:07
问题 I am trying to read a text file encoded in Shift-JIS (cp 932) using std::wifstream, and std::getline. The following code works in VS2010 but fails in VS2013: std::wifstream in; in.open("data932.txt"); const std::locale locale(".932"); in.imbue(locale); std::wstring line1, line2; std::getline(in, line1); std::getline(in, line2); const bool good = in.good(); The file contains several lines, where the first line contains just ASCII characters, and the second is Japanese script. Thus, when this

What are the best practices for internationalizing a Java Swing desktop application?

老子叫甜甜 提交于 2019-12-30 02:30:05
问题 I'm sure there are a lot of methods, but what's the recommended way to do this that has the least amount of impact to your code? The obvious is that you create properties files, but how do you swap the values in the rendering? In J2EE you always just re-render the whole page so it's easy. But in Swing apps, do you just add the code for the .getProperty() in the paintComponent(Graphics g) method? If that's the case, doesn't it seem heavy since now you'll have to override this method everywhere

Displaying UTF-8 encoded Chinese characters in R

好久不见. 提交于 2019-12-30 02:16:27
问题 I try to open a UTF-8 encoded .csv file that contains (traditional) Chinese characters in R. For some reason, R displays the information sometimes as Chinese characters, sometimes as unicode characters. For instance: data <-read.csv("mydata.csv", encoding="UTF-8") data will produce unicode characters, while: data <-read.csv("mydata.csv", encoding="UTF-8") data[,1] will actually display Chinese characters. If I turn it into a matrix, it will also display Chinese characters, but if I try to

How to make strtotime parse dates in Australian (i.e. UK) format: dd/mm/yyyy?

北城余情 提交于 2019-12-29 06:47:08
问题 I can't beleive I've never come across this one before. Basically, I'm parsing the text in human-created text documents and one of the fields I need to parse is a date and time. Because I'm in Australia, dates are formatted like dd/mm/yyyy but strtotime only wants to parse it as a US formatted date. Also, exploding by / isn't going to work because, as I mentioned, these documents are hand-typed and some of them take the form of d M yy . I've tried multiple combinations of setlocale but no