How can I determine what the alphabet for a locale is in java?

前端 未结 5 1432
生来不讨喜
生来不讨喜 2020-12-16 05:14

I would like to determine what the alphabet for a given locale is, preferably based on the browser Accept-Language header values. Anyone know how to do this, using

5条回答
  •  北海茫月
    2020-12-16 05:49

    If you just want to know the name of an appropriate character set for a users locale then you might try the nio.CharSet class.

    If you really want to use the Accept-Language header, then there's an old O'Reilly article on this matter which introduces a pretty handy class called LanguageNegotiator.

    I think one of those will give you a decent enough start.

提交回复
热议问题