locale

Practical way to parse a float with newlib without locale support

随声附和 提交于 2019-12-11 16:48:23
问题 I'm experimenting with NIOS II soft core, trying to minimize the footprint of my embedded app. One of the biggest gains I get comes from using the small C library (p 206): The full newlib library functionality is often unnecessary for embedded systems, and undesirably large for systems needing a minimal RAM footprint. Altera provides a reduced-functionality reduced-size "Small C" version of newlib which allows smaller RAM footprints to be achieved. One of the features stripped down from small

std::isgraph asserts, how to fix?

 ̄綄美尐妖づ 提交于 2019-12-11 15:57:02
问题 Im getting the following assert when calling std::isgraph: _ASSERTE(c >= -1 && c <= 255); It's a unicode built on Windows platform, but the locale is reported as "c". What should I set the locale to in order to support unicode ? 回答1: Nothing. std::isgraph has nothing to do with Unicode. In particular, it cannot support any character value out of the range you've mentioned. You could pass it individual bytes of a [say, UTF-8] codepoint, sure, but that wouldn't tell you anything. It's simply

Locale based sorting of arrays in PHP gives different result on OS X than Ubuntu

纵饮孤独 提交于 2019-12-11 15:51:19
问题 Given the following array: $foo = ["a", "B", "æ", "Æ", "c", "A", "b", "C", "1"]; Then I set the locale with setlocale(LC_ALL, ['nb_NO.UTF-8', 'no_NO.UTF-8']); and run the array through sort($foo, SORT_LOCALE_STRING) . In Ubuntu, the sorted array will then look like: [ 0 => '1', 1 => 'A', 2 => 'a', 3 => 'B', 4 => 'b', 5 => 'C', 6 => 'c', 7 => 'Æ', 8 => 'æ', ] While on Mac (OS X) I get: [ 0 => '1', 1 => 'A', 2 => 'B', 3 => 'C', 4 => 'a', 5 => 'b', 6 => 'c', 7 => 'Æ', 8 => 'æ', ] It seems OS X

Ubuntu Php Locale ru_RU not working

旧城冷巷雨未停 提交于 2019-12-11 14:25:50
问题 Code: <?php setlocale(LC_ALL, 'ru_RU'); $date_ru = strftime('%d %B %Y', strtotime('2018-01-31')); echo($date_ru); ?> Outputs: 1) Local Server: 31 января 2018 2) Remote Server: 31 ������ 2018 (exactly those strange symbols instead of month-name). Settings: I've checked locales installed with local -a and run php -i to get info about both servers. Local Server: ru_RU ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.KOI8-R ru_RU.UTF-8 ... and all the rest possible locales in all languages... $

NumberFormat.parse() does not work for FRANCE Locale space as thousand seperator

本秂侑毒 提交于 2019-12-11 13:42:56
问题 I have written below Java code to see how locales behave with numbers. I am facing with FRENCH style. double n = 123456789.123; System.out.println("US "+ NumberFormat.getNumberInstance(Locale.US).format(n)); //###,###.### System.out.println("FRENCH "+ NumberFormat.getNumberInstance(Locale.FRENCH).format(n)); // # ###,## System.out.println("GERMAN "+ NumberFormat.getNumberInstance(Locale.GERMAN).format(n)); // ###.###,## System.out.println(NumberFormat.getNumberInstance(Locale.US).parse("123

Cakephp 3.0.0-RC2 I18n::locale() doesn't works

丶灬走出姿态 提交于 2019-12-11 13:15:59
问题 I am using Cakephp 3.0.0-RC2. It work's fine but I can't change du language of the user at login. My login function doesn't work. It do nothing : public function login() { if ($this->request->is('post')) { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); I18n::locale($user['lang']); return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error(__("Nom d'utilisateur ou mot de passe incorrect, essayez à nouveau.")); } } Notice that when I change the

CDate function using different locales

孤者浪人 提交于 2019-12-11 13:11:59
问题 I am using QTP (therefore VBScript) and I seem to have a problem with the CDate function. When my colleague in Malaysia is using it there is not a problem. When I use it here in Spain I have the following error. Now all I am asking is if there are any known issues with this function or any other related ones like FormatDateTime between different locales. Anybody knows this? Thanks in advance. 回答1: The error specifies the problem. todateObject.GetROProperty("value") contains a value that CDate

Force “locale” in application

浪子不回头ぞ 提交于 2019-12-11 13:05:58
问题 I want to rotate my phone and keep the locale. I have folders values, values- en and values- hr . In every activity I have android:configChanges="keyboardHidden|orientation|locale" and in every activity.java file I have private Locale locale = null; @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (locale != null) { newConfig.locale = locale; Locale.setDefault(locale); getBaseContext().getResources().updateConfiguration

java.util.Locale making Country LowerCase

梦想与她 提交于 2019-12-11 12:58:20
问题 I am setting java.util.Locale localeWithoutCountryCode = new Locale("fr_FR"); But when I retrieve its value, it returns me "fr_fr" ( Lowercase country) and this is causing my message lookups to fail. I want it to keep the country case as is. 回答1: The single-argument constructor for Locale takes exactly an ISO language as its parameter; you're passing in a language and variant. Use new Locale("fr", "FR") instead. If this is hard-coded for some reason, you can just use Locale.FRANCE . 来源: https

How do I remove the difference in locale between gui and commandline interfaces of same program?

让人想犯罪 __ 提交于 2019-12-11 11:19:26
问题 The program saves a settings file as text which contains floating point numbers of type long double . The settings file can only be saved via the GUI (GTK2), while files can also be loaded via the command line and without bringing up the GUI. Unfortunately, a user reports that in the files he has saved, due to his locale setting, the numbers are formatted with commas and the program refuses to load them (emitting error messages) from the command line but seems to load them when the GUI is