How to find if a locale is supported by given encoding?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaibarde
    New Member
    • Aug 2009
    • 2

    How to find if a locale is supported by given encoding?

    Hi,

    I have a need to show list of locales into a field on a wizard ( a Java based application). But these locales should be such that they are supported by the current character set (encoding) selected by the user on his machine. Is there any Java utility function or set of function or package, using which, I can somehow figure out my current character set / encoding would support the given locale?



    Thanks,

    ~jaideep
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by jaibarde
    Hi,

    I have a need to show list of locales into a field on a wizard ( a Java based application). But these locales should be such that they are supported by the current character set (encoding) selected by the user on his machine. Is there any Java utility function or set of function or package, using which, I can somehow figure out my current character set / encoding would support the given locale?
    The coupling between fonts, locales and encodings is very weak, e.g. you can write Croatian using a Japanese character set or write Russian using an ordinary ASCII character set. Your best bet are the Font.canDisplay ( ... ) and Font.canDisplay UpTo( ... ) methods; read their API documentation.

    kind regards,

    Jos

    Comment

    • jaibarde
      New Member
      • Aug 2009
      • 2

      #3
      Thanks Jos,
      I'll go through the documentation and get back to you in case of more doubts.
      ~jaideep

      Comment

      Working...