icu

ICU support in a 32-bit build of Qt5 with the VS2012 compiler causes Qt5 build failure; Webkit is also therefore unbuildable

北慕城南 提交于 2019-12-12 16:42:22
问题 I have run into another in a long stream of obstacles attempting to build Qt5 with the VS2012 compiler. When ICU is enabled ("-icu" on the configure command line, along with a proper 32-bit build of ICU in VS2012 and proper inclusion of all ICU paths (header, .lib, and .dll)), Line 688 of qtbase\src\corelib\codecs\qtextcodec.cpp returns a NULL codec (ICU fails to return a codec) when asked for a codec whose name is "US-ASCII". Specifically: QTextCodec* QTextCodec::codecForLocale() {

ICU Unicode Normal vs Fullwidth

醉酒当歌 提交于 2019-12-12 09:58:56
问题 I am somewhat new to unicode and unicode strings. I'm trying to determine the difference between "fullwidth" symbol and a normal one. Take these two for example: Normal: http://www.fileformat.info/info/unicode/char/20a9/index.htm Fullwidth: http://www.fileformat.info/info/unicode/char/ffe6/index.htm I notice that the fullwidth is defined as U+20A9 and coincidentally 20A9 is the normal one. So what is the value of U? When using libraries like ICU is there a way to specify always return normal

Get an ISO 15924 script code for a given IETF Language tag (or ISO 639-ISO 3166-1 pair)

送分小仙女□ 提交于 2019-12-12 08:14:05
问题 I'm integrating ICU into some in-house software. I'd like to be able to take a string such as "en_US" and get the script name "Latin" for it. (Though ultimately I actually want an ICU ScriptCode.) I tried using ICU's Locale class, but this code: Locale *ul = new Locale("en_US",); LOG(ul->getScript()); Logs an empty string, despite the documentation indicating that this is the use case. I even tried it using the Locale class' static method Locale::getEnglish and still got an empty string. I'm

Localizing apps for non-standard locales

别说谁变了你拦得住时间么 提交于 2019-12-12 03:29:32
问题 I am writing an app which should support a language which is not in the list of available (40?) languages on the device, but the region format is. I want to localize the name of days as well as "yesterday...". The problem is, that days (Monday,...) are fetched using NSLocale and therefore work on any device, but words like "yesterday" have to be localised to a language amongst the 40 or so. Even though XCode lets me localize for the wanted region, the device uses the standard language, in my

Using ICU to implement my own codecvt facet

孤街醉人 提交于 2019-12-12 03:06:38
问题 I want to implement a codecvt facet using ICU to convert from any character encoding (that ICU supports) to UTF-8 internally. I'm aware that codecvt_byname exists and that it can be used to do part of what I want as shown in this example. The problems with that example are that it (1) uses wide character streams (I want to use "regular", byte-oriented streams) and (2) requires 2 streams to perform the conversion. Instead, I want a single stream like: locale loc( locale(), new icu_codecvt(

Choosing encoding for icu::UnicodeString

时光怂恿深爱的人放手 提交于 2019-12-11 23:24:16
问题 I found myself in need of a way to change a string to lower case that was safe to use for ASCII and for UTF16-LE (as found in some windows registry strings) and came across this question: How to convert std::string to lower case? The answer that seemed to be the "most correct" to me (I'm not using Boost) was one that demonstrated using the icu library. In this answer, he specified the encoding "ISO-8859-1" for the UnicodeString constructor. Why is this the correct value and how do I know what

Changing the pattern for CHF currency in Java using icu package?

旧城冷巷雨未停 提交于 2019-12-11 17:44:04
问题 I wrote a java function that shows the locale pattern for each currency. See the function below. What I am interested to know is that why when the currency is CHF, the 2nd decimal is hardcoded to 5? Note that I am using icu package and this issue doesn't exist with java.util.Currency package. I am using the default locale of en_US. Here is the output of the function which is related to USD and CHF currencies: Analyzing currency: [USD] localePattern: [¤#,##0.00;(¤#,##0.00)] Currency symbol [$]

NumberFormat/DecimalFormat treats certain floating-point values as longs instead of doubles

不问归期 提交于 2019-12-11 14:54:38
问题 NumberFormat/DecimalFormat doesn't seem to parse strings with the "#.0" format (where # is any number) as a double. The following code illustrates this: #include <cstdio> #include <iostream> #include <unicode/decimfmt.h> #include <unicode/numfmt.h> #include <unicode/unistr.h> #include <unicode/ustream.h> int main() { UErrorCode status = U_ZERO_ERROR; // DecimalFormat doesn't work either NumberFormat* f = NumberFormat::createInstance(status); f->setGroupingUsed(false); f->setParseIntegerOnly

Why do I get link errors when the symbol is clearly present in the static library I link against?

孤者浪人 提交于 2019-12-11 13:49:18
问题 I've decided to start using ICU in my project, but sadly VS2015 is officially unsupported (i.e. the developers list the incompatibility as a known issue). Luckily someone was kind enough to fix the problems on their own and share the binaries with the world: http://www.npcglib.org/~stathis/blog/precompiled-icu/ . I've downloaded the ICU 56 VS15 package and I'm trying to compile the following simple program: #include <iostream> #include <unicode\unistr.h> int main() { auto myStr = icu:

How do I normalize a string using ICU4C?

点点圈 提交于 2019-12-11 12:18:12
问题 I find the ICU docs somewhat challenging. My question is: How do I normalize a string using ICU4C? I'm looking at unorm2_normalize, but what if the buffer isn't large enough? How would I know this before? Naturally, I want to normalize the entire string. Thanks! :> P.S. Here is the API doc on that function: http://icu-project.org/apiref/icu4c/unorm2_8h.html#a0a596802db767da410b4b04cb75cbc53 回答1: You get a error code back from all these function call in the pErrorCode parameter. This is how