Questions tagged [icu]

The International Components for Unicode is a set of cross-platform open source C/C++ and Java libraries for Unicode and globalization support. It is developed by the Unicode Consortium. Use this tag when you have a question about using the ICU. Be sure to include the appropriate language tag and the version of ICU that you are using.

The International Components for Unicode supports C/C++ (ICU4C) and Java (ICU4J), and is available under an open source license. See the ICU-TC home page for documentation and licensing details.

It uses .

771 questions
7
votes
1 answer

formatting numbers(spellout) with icu4j

I want to localize numbers by spelling them out with a locale and ended up using ICU4J. I succeeded in many locales but didn't seem to get it done for a few like Georgian, Turkish or Arabic. ULocale locale = new ULocale("Tr"); //Turkish Double d =…
7
votes
1 answer

Android and ICU 5.0

I started to use ICU4J in my Android project. But when I run the project on a device, at launch, I have a crash. Here is the error : FATAL EXCEPTION: main java.lang.ExceptionInInitializerError at…
Kyu_
  • 800
  • 4
  • 10
  • 18
7
votes
1 answer

How to debug linker errors? Getting undefined reference errors when statically linking ICU

I've built the static libraries for ICU 49 and 50 but when linking with either one of them I still get 667 linker errors like the ones below. How can I approach debugging this and figuring out what the problem is? The ICU support list has offered no…
Eloff
  • 20,828
  • 17
  • 83
  • 112
7
votes
3 answers

Which Regular Expression flavour is used in Python?

I want to know which RegEx-flavour is used for Python? Is it PCRE, Perl compatible or is it ICU or something else?
extreme001
  • 303
  • 1
  • 5
  • 16
7
votes
3 answers

How to get the language name in native language?

This is my first time using ICU API, and I'm having a very hard time trying to find out something that I assumed to be very simple: to get a given locale/language name in the native language (instead of in English) Examples: fr -> Français en …
MestreLion
  • 12,698
  • 8
  • 66
  • 57
6
votes
3 answers

icu: Sort strings based on 2 different locales

As you probably know, the order of alphabet in some (maybe most) languages is different than their order in Unicode. That's why we may want to use icu.Collator to sort, like this Python example: from icu import Collator, Locale collator =…
saeedgnu
  • 4,110
  • 2
  • 31
  • 48
6
votes
0 answers

How to stop C++20 std::chrono zoned_time printing GMT-4 instead of EST?

Previously I used Howard Hinnant's "date.h" header library but I recently switched to C++20's std::chrono (which is basically an implementation of Howard's cool library) but I cannot get the timezone abbreviations to print in a normal way (e.g. EST…
David A
  • 123
  • 5
6
votes
1 answer

NumberFormatter with singular / plural word

Is it possible to use PHP NumberFormatter class to display words in singular or plural depending on the number value using the setPattern method? This method is using the ICU DecimalFormat library, but I am not familiar with it. I would like to use…
Seb33300
  • 7,464
  • 2
  • 40
  • 57
6
votes
2 answers

How to install libicu-dev on Ubuntu

I am trying install gollum by gem on Ubuntu 14.10. When I try to use gem install gollum, I see the error below: /usr/bin/ruby2.1 extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h ERROR: Error installing gollum: …
mashpolo
  • 61
  • 1
  • 1
  • 6
6
votes
1 answer

Why does ICU's Locale::getDefault() return "root"?

Using the ICU library with C++ I'm doing: char const *lang = Locale::getDefault().getLanguage(); If I write a small test program and run it on my Mac system, I get en for lang. However, inside a larger group project I'm working on, I get root.…
Paul J. Lucas
  • 6,895
  • 6
  • 44
  • 88
6
votes
1 answer

Using boost::locale/ICU boundary analysis with Chinese

Using the sample code from the boost::locale documentation, I can't get the following to correctly tokenize Chinese text: using namespace boost::locale::boundary; boost::locale::generator gen; std::string text="中華人民共和國"; ssegment_index…
Uri Granta
  • 1,814
  • 14
  • 25
6
votes
1 answer

ICU iterate codepoints

My objective is to iterate strings of Unicode text character by character but the code below is iterating code units instead of code points even though I am using next32PostInc() which is supposed to iterate code points: void…
Caroline Beltran
  • 888
  • 2
  • 9
  • 22
6
votes
2 answers

How to convert a Unicode code point to characters in C++ using ICU?

Somehow I couldn't find the answer in Google. Probably I'm using the wrong terminology when I'm searching. I'm trying to perform a simple task, convert a number that represents a character to the characters itself like in this table:…
OopsUser
  • 4,642
  • 7
  • 46
  • 71
6
votes
4 answers

How to install charlock_holmes dependency libicu-dev on Heroku

I'm using the ruby gem charlock_holmes in a Rails 4 app to detect the character encodings of CSV's that I'm parsing so that CSV.foreach doesn't throw an error. However, when I try to push to heroku (with gem 'charlock_holmes' in the Gemfile) I get…
silasjmatson
  • 1,814
  • 18
  • 37
6
votes
2 answers

Compiling the icu sqlite extension statically linked to icu

I want to compile the icu sqlite extension statically linked to icu. This is what I've tried, maybe the mistake is obvious to you. > cd icu/source > ./runConfigureIcu Linux --enable-static --with-packaging-format=archive ... > make > cd…
Georg Schölly
  • 124,188
  • 49
  • 220
  • 267