Questions tagged [icu4j]

ICU - International Components for Unicode

This extends Java's Unicode and internationalization support, focusing on improving performance, keeping current with the Unicode standard, and providing richer APIs, while remaining as compatible as possible with the original Java text and internationalization API design.

49 questions
26
votes
1 answer

How can I get the "current" IANA time zone abbreviation throughout time in ICU4J?

I'm currently trying to write a suite of time zone validation programs to see whether various platforms interpret the IANA time zone data. The output format I'm targeting includes the abbreviation in effect for a particular time - such as "BST" for…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
7
votes
2 answers

HTML ASCII Case Insensitive ICU Collator

I need to create a Collator which corresponds to https://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive/ i.e. it ignores the case sensitivity of ASCII A-Z and a-z characters when making comparisons. I have attempted this with…
adamretter
  • 3,885
  • 2
  • 23
  • 43
6
votes
1 answer

Which romanization standard should be used to improve ICU4j transliteration for Arabic-Latin?

We have a requirement to transliterate Arabic text to Latin characters(without diacritical marks) and display them to users. We are currently using IBM ICU4j for this. The API doesn't trasliterate well the Arabic text into proper readable latin…
Kamlesh Sharma
  • 222
  • 1
  • 7
  • 23
6
votes
2 answers

How to use unsupported Locale in Java

As part of Internationalisation, got a requirement to support few countries like Antigua and Barbuda - ISO3166 code - AG & Dominican Republic - ISO3166 code - DO Locale loc = new Locale("en", "AG"); DateFormat df1 =…
ss_Dev
  • 63
  • 5
5
votes
1 answer

Stripping data files from ICU4J when used in a Library

I have an internal library that is included in different android apps. This library depends on ICU4J. This means we add ~10MB to the final APK. The lib uses a subset of ICU4J so I would like to remove all the non-necessary data files. From the ICU…
fstephany
  • 2,254
  • 3
  • 25
  • 32
4
votes
0 answers

Add constant value to timestamp to convert date to Gregorian

I need to convert Persian (Shamsi) date to Gregorian date. I search alot and find different solution. The most reliable answer seems to be ibm library; icu4j. So, I start to play with it in order to change date, but the presented examples do not…
Narges
  • 1,345
  • 6
  • 14
  • 29
3
votes
1 answer

Convert an ordinal string to an integer with icu4j

I am attempting to convert an ordinal string, say "FOURTH" to integer 4. How can I accomplish this with the International Components for Unicode library for Java, icu4j? RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(Locale.US,…
dojie
  • 33
  • 4
3
votes
1 answer

BreakIterator in Android counts character wrongly

I am using BreakIterator to count the number of visible character in a String. This works perfectly for English language. But in case of Hindi language it doesn't work as expected. The below String has a length of 3, but is considered as single…
Henry
  • 17,490
  • 7
  • 63
  • 98
2
votes
0 answers

ICU4j - How to override the currency symbol or add customized currency with Numberformatter

I want to override the currency symbol. For example, ICU only returns BGN 0.67 with currencyCode BGN no matter which options I use (Narrow, Short, and VARIANT in here) for en locale, but I would like to get лв 0.67. We also have other use cases to…
sam
  • 21
  • 1
2
votes
1 answer

I get wrong output in ICU4J library

I want to convert date from Persian calendar to Gregorian Calendar. For this, I use ICU4J library (version 65.1). The problem is that this library gives wrong output for some dates. Here is my code: ULocale locale = new…
farhad
  • 105
  • 1
  • 9
2
votes
0 answers

Ignore Japanese Characters for ICU4J transliterations

Is there a way to ignore the all the Japanese characters for Transliteration using the ICU4J library? What are the IDs of the transliterators that participate in the Japanese Transliteration? The code to generate all the available transliterators…
TryinHard
  • 4,078
  • 3
  • 28
  • 54
2
votes
2 answers

icu4j transliteration English to urdu

I'm trying to transliterate roman English words to Urdu words. much like this website tool. I'm using icu4j transliterator. Output transliteration is little unexpected e.g. input : "namaz" output : "نَمَز" expected output : "نماز" English…
Muzammil Husnain
  • 1,218
  • 1
  • 10
  • 24
2
votes
3 answers

Android N : how can i migrate from Android SDK API to Android ICU API

I was confused related ICU4J , if i want to upgrade my application version to Support Android N . How can i migrate from previous Android SDK to Android ICU API . For Example if i have used Calendar in my Application Using java.util.Calendar , will…
Salman Nazir
  • 2,759
  • 2
  • 28
  • 42
2
votes
1 answer

How to merge transliteration rules in ICU4J?

I am using ICU4J and trying to merge transliteration rules. For the end result I need to have all German umalaut characters converted to their DIN 5007-2 alternatives and all non ASCII characters converted to their ASCII versions. When I try to do…
Krystian Marek
  • 331
  • 4
  • 19
2
votes
3 answers

Transliterate German umlauts using icu4j into their DIN 5007-2 alternatives

I would like to be able to transliterate German umlaut characters Ü ü ö ä Ä Ö into their DIN 5007-2 alternatives ä → ae ö → oe ü → ue Ä → Ae Ö → Oe Ü → Ue ß → ss (or SZ) like in this…
Krystian Marek
  • 331
  • 4
  • 19
1
2 3 4