icu

unicode support in android ndk

你说的曾经没有我的故事 提交于 2019-11-30 02:13:10
I have a large C/C++ library that I need to use as part of an Android NDK project. This library needs to be able to intelligently process UTF8 strings (for example, conversion to lowercase/uppercase). The library has conditional compilation to punt to an OS API to do the conversion, but there don't seem to be any Android APIs for UTF8. (mbstowcs, etc) This thread says to use JNI methods to do it (!), which is a rather heavy-weight solution. I was thinking about building ICU , but as it uses GNU Autotools I'm not sure I can make it work with the NDK toolchain. :/ Has anyone else confronted this

Enthought Canopy 1.1 giving error icui18n: cannot open shared object file: No such file or directory

感情迁移 提交于 2019-11-29 11:16:57
I have tried to get enthought canopy and follow the procedure. However, when I tried to run ./canopy , it gave this error: Unable to load library icui18n "Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)". I cannot sudo because I am using the university's supercomputing account, no permission to do so. Any advice? You just need a copy of ICU installed on the system you are trying to run canopy on. You can do this by either installing it via the OS's package manager, or by getting a copy in your home directory, and telling canopy where to find it

Code to strip diacritical marks using ICU

我的梦境 提交于 2019-11-29 07:30:28
Can somebody please provide some sample code to strip diacritical marks (i.e., replace characters having accents, umlauts, etc., with their unaccented, unumlauted, etc., character equivalents, e.g., every accented é would become a plain ASCII e ) from a UnicodeString using the ICU library in C++? E.g.: UnicodeString strip_diacritics( UnicodeString const &s ) { UnicodeString result; // ... return result; } Assume that s has already been normalized. Thanks. ICU lets you transliterate a string using a specific rule. My rule is NFD; [:M:] Remove; NFC : decompose, remove diacritics, recompose. The

How to get the default currency from the PHP Intl ( ICU library )

左心房为你撑大大i 提交于 2019-11-29 04:54:56
I use PHP, and like to know how I can get the default currency for a locale via the Internationalization extension (Wrapper for the ICU library)? Below is a script that explains, what and why. I need something to replace the getCurrCode() function with. $accepted_currencies = array('USD','EUR'); $locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); if( ! empty($locale)){ Locale::setDefault($locale); $currency = getCurrCode(); if( ! in_array($currency, $accepted_currencies)){ $currency = 'USD'; } }else{ Locale::setDefault('en_US'); } $fmt = new NumberFormatter( $locale,

iPhone app rejection for using ICU (Unicode extensions)

泪湿孤枕 提交于 2019-11-28 12:15:48
I received the following mail form Apple, considering my application: Thank you for submitting your update to Νομοθεσία to the App Store. During our review of your application we found it is using private APIs, which is in violation of the iPhone Developer Program License Agreement section 3.3.1; "3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs." While your application has not been rejected, it would be appropriate to resolve this issue in your next update. The following non-public APIs are included in your application

Code to strip diacritical marks using ICU

折月煮酒 提交于 2019-11-28 01:18:21
问题 Can somebody please provide some sample code to strip diacritical marks (i.e., replace characters having accents, umlauts, etc., with their unaccented, unumlauted, etc., character equivalents, e.g., every accented é would become a plain ASCII e ) from a UnicodeString using the ICU library in C++? E.g.: UnicodeString strip_diacritics( UnicodeString const &s ) { UnicodeString result; // ... return result; } Assume that s has already been normalized. Thanks. 回答1: ICU lets you transliterate a

Is there an STL and UTF-8 friendly C++ Wrapper for ICU, or other powerful Unicode library [closed]

喜欢而已 提交于 2019-11-27 13:36:48
问题 I need a good Unicode library for C++. I need: Transformations in a Unicode sensitive way. For example sort all strings in a case insensitive way and get their first characters for index. Convert various Unicode strings to upper and to lower case. Split text at a reasonable position -- words that would work for Chinese and Japanese as well. Formatting numbers, dates in locale sensitive way (should be thread safe). Transparent support of UTF-8 (primary internal representation). As far as I

Cross-platform iteration of Unicode string (counting Graphemes using ICU)

余生长醉 提交于 2019-11-27 12:09:11
I want to iterate each character of a Unicode string, treating each surrogate pair and combining character sequence as a single unit (one grapheme). Example The text "नमस्ते" is comprised of the code points: U+0928, U+092E, U+0938, U+094D, U+0924, U+0947 , of which, U+0938 and U+0947 are combining marks . static void Main(string[] args) { const string s = "नमस्ते"; Console.WriteLine(s.Length); // Ouptuts "6" var l = 0; var e = System.Globalization.StringInfo.GetTextElementEnumerator(s); while(e.MoveNext()) l++; Console.WriteLine(l); // Outputs "4" } So there we have it in .NET. We also have

iPhone app rejection for using ICU (Unicode extensions)

旧街凉风 提交于 2019-11-27 06:53:27
问题 I received the following mail form Apple, considering my application: Thank you for submitting your update to Νομοθεσία to the App Store. During our review of your application we found it is using private APIs, which is in violation of the iPhone Developer Program License Agreement section 3.3.1; "3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs." While your application has not been rejected, it would be appropriate to

icu4j cyrillic to latin

六月ゝ 毕业季﹏ 提交于 2019-11-27 04:28:34
问题 I'm trying to get Cyrillic words to be in latin so I can have them in urls. I use icu4j transliterator, but it still gives weird characters like this: Vilʹândimaa . It should be more like viljandimaa . When I copy that url these letters turn to %.. something useless. Does anybody know how to get Cyrillic to a-z with icu4j? UPDATE Can't answer myself already but found this question that was very helpful: Converting Symbols, Accent Letters to English Alphabet 回答1: Modify your identifier to do