locale

Fixing "perl: warning: Setting locale failed."

谁都会走 提交于 2020-01-09 20:32:08
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 错误提示: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = (unset), LC_PAPER = "en_US", LC_ADDRESS = "en_US", LC_MONETARY = "en_US", LC_NUMERIC = "en_US", LC_TELEPHONE = "en_US", LC_IDENTIFICATION = "en_US", LC_MEASUREMENT = "en_US", LC_TIME = "en_US", LC_NAME = "en_US", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). 解决办法: apt-get install language-pack-en-base /usr/sbin/locale-gen en_US.UTF-8 /usr/sbin/update

What is the correct Windows setlocale for the United Arab Emirates?

耗尽温柔 提交于 2020-01-07 04:44:28
问题 Dear Arab reader from the United Arab Emirates, I am on my way to port my Linux code to pure Windows. This code, among others, is pretending to turn a Gregorian date (internally a Unix date) to an Hijri date and display the result using the Arab United Emirates locale. The true reason why I need you is to correctly set your nation's locale under Windows and its C runtime. So far I have tested many combinations of the "Arabic_United Arab Emirates.1256" string as clearly documented as such by

Traditional Spanish sorting of Strings in Java

和自甴很熟 提交于 2020-01-06 20:01:17
问题 I'm converting a .NET application into Java. The app reads in a file with this format: es-MX jueves verde amarillo blanco llave llover loma cinco domingo rojo but I'm having a trouble figuring out how to sort Spanish according to the traditional sorting of words. In VB.NET, you'd do see this: Dim spainCultureTraditional As CultureInfo = New CultureInfo(&H40A) but I can't find the equivalent traditional sorting locale in Java. The only difference between the two is that in es-MX/es-ES llave

Sort for Czech characters PHP - issue in compare function

独自空忆成欢 提交于 2020-01-06 14:42:05
问题 I'm making sorted sorting of Czech (and other) characters. I wrote a compare function but there is a problem with strstr: Warning: strstr() [function.strstr]: needle is not a string or an integer in ... And second problem is that it doesn't compare it correctly. I checked the manual of usort and some examples and think it should be ok, but something is wrong. I also check $a->getJmenoSouboru() and $b->getJmenoSouboru() on string and it is really string. So I don't understand to that warning.

Sort for Czech characters PHP - issue in compare function

我的未来我决定 提交于 2020-01-06 14:41:17
问题 I'm making sorted sorting of Czech (and other) characters. I wrote a compare function but there is a problem with strstr: Warning: strstr() [function.strstr]: needle is not a string or an integer in ... And second problem is that it doesn't compare it correctly. I checked the manual of usort and some examples and think it should be ok, but something is wrong. I also check $a->getJmenoSouboru() and $b->getJmenoSouboru() on string and it is really string. So I don't understand to that warning.

symfony2: how to parameter localization so we can have 2 languages?

假如想象 提交于 2020-01-06 04:29:05
问题 In my symfony2 application, I have set up JMSI18nRoutingBundle : http://jmsyst.com/bundles/JMSI18nRoutingBundle I have the following config: jms_i18n_routing: default_locale: fr locales: [fr, en] strategy: prefix_except_default I have set up a controller action to change the locale: /** * @Route("/public/change_locale/{locale}", name="change_locale", requirements={"locale" = "fr|en"}) * @Template(":Core/Admin:test.html.twig") * @param Request $request * @param string $locale * @return array *

Parsing string to date with timezone in national format

南笙酒味 提交于 2020-01-06 03:05:54
问题 I try to parse string (russian locale) "01 августа 2014, пятница. 20:00 МСК" to java.util.Date. I try this code: String dateString = "01 августа 2014, пятница. 20:00 МСК" Locale rusLocale = new Locale.Builder().setLanguage("ru").setScript("Cyrl").build(); String pattern = "dd MMMM yyyy, EEEE. HH:mm z" Date date = SimpleDateFormat(pattern, rusLocale).parse(dateString) With month and weekday this code work fine, but when I try to parse string with timezone name МСК I get java.text

Date Format with Locale

大憨熊 提交于 2020-01-05 23:07:32
问题 I want to display date according to each country's date format. I have tried many ways finally I found this example http://www.java2s.com/Code/Java/Data-Type/DateFormatwithLocale.htm Which gives the perfect output of what I meant. Some countries like Germany won't use 12hr formats instead they uses 24 hr formats with no AM/PM . While some countries like US uses 12hr formats. But I found that while running this java class it returns the correct output as expected but while running this inside

Date Format with Locale

我只是一个虾纸丫 提交于 2020-01-05 23:06:14
问题 I want to display date according to each country's date format. I have tried many ways finally I found this example http://www.java2s.com/Code/Java/Data-Type/DateFormatwithLocale.htm Which gives the perfect output of what I meant. Some countries like Germany won't use 12hr formats instead they uses 24 hr formats with no AM/PM . While some countries like US uses 12hr formats. But I found that while running this java class it returns the correct output as expected but while running this inside

How do I get the current time in a different TimeZone in Java?

半城伤御伤魂 提交于 2020-01-05 15:44:14
问题 OK - I feel pretty dumb asking such a basic question, but hey. I'm trying to get the current time in a different timezone in a Java webapp. I've tried the following obvious solution: in my servlet, Calendar localCalendar = Calendar.getInstance(myBean.getTimeZone()); then I pass the calendar object through to a JSP as a request attribute 'localCalendar': It is now: [${requestScope.localCalendar.time}] in TimeZone ${requestScope.localCalendar.timeZone.ID} but my output seems to ignore the