The i18n Cookbook - recipies for a global society

  • java cookbook
  • about the author
Home › Java Internationalization Cookbook › Unicode, Transliteration, and Charactersets

Java Cookbook

  • Java Internationalization Cookbook
    • Locales
    • Dates and Times
    • Numerical Systems
    • Misc
    • Resource Bundles
    • Unicode, Transliteration, and Charactersets
      • Convert text from one script to another
      • Detect the Charset of a URL
      • Get Transliterators available source ids
      • Get all available transliterator ids
      • Get available target ids for a Transliterator source id
      • Read a Unicode file
      • Write a Shift_JIS Japanese file

Get Transliterators available source ids

Problem:

You want to retireve all available source ids for a Transliterator.

Solution:

A Transliterator is created using a combination of a source and a target id joined by a hyphen. 

To get a list of all sources:

//Get an Enumeration of available source ids
Enumeration<String> ids = Transliterator.getAvailableSources();
//Loop through available ids and output them to the console
while(ids.hasMoreElements()){
    String id = ids.nextElement();
    System.out.println(id);
}

 


The output:

Arabic
Hangul
Tamil
Thaana
Gujarati
Simplified
Han
Telugu
Syriac
Devanagari
Name
Publishing
Digit
Latin
Kannada
NumericPinyin
Jamo
Any
Fullwidth
Cyrillic
Armenian
Georgian
Katakana
Hex
Malayalam
Oriya
Pinyin
Tone
Thai
Greek
Hiragana
Halfwidth
Hebrew
Accents
Traditional
Bengali
Gurmukhi
 

 

‹ Detect the Charset of a URL up Get all available transliterator ids ›
  • Java
  • transliterator
  • Printer-friendly version
  • Add new comment

If you are testing any of these recipes in Eclipse and the characters are not displaying correctly in your console visit http://i18ncookbook.com/eclipse_settings.

This site is ad supported.  I hope you find something among our sponsors worth clicking. ;)

i18n search

Google
Custom Search

Search

Tags in Tags

calendar date icu4j Java Locale number format numberformat parse spellout timezone transliteration transliterator
more tags

User login

  • Create new account
  • Request new password
  • java cookbook
  • about the author