• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

NIO and Internationalization

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings from beautiful Sandy Springs, Georgia.
Since I'm studying for the SCEA exam, streams and internalization are on my mind quite a bit these days.
How does NIO provide for internationalization?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mhh, it seems to me that NIO is mainly about the mechanics of writing/reading something, whereas i18n is about *what* to write. So, aren't that somewhat orthogonal issues?
What would you expect from NIO in regards to i18n?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In traditional IO, InputStreamReader and OutputStreamWriter provide for conversion between byte streams and character streams (Readers and Writers) using named character encodings. NIO has similar functionality provided by Charset, CharsetEncoder and CharsetDecoder. These do things like convert a ByteBuffer into a CharBuffer view and vice versa.
 
Author
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As the previous posters have pointed out, NIO doesn't directly address I18N. There is a new package in NIO, java.nio.charset, which is all about character sets but it's concerned only with transcoding between character sequences and byte streams.
NIO is really only involved at the plumbing level in I18N. The Charset class let's you define your own character sets and gives you complete control over their endcoding/decoding rules.
Character sets you create may be added to the JVM for general use (including by Readers and Writers) but that's the extent of it. NIO knows nothing about Locales, number formatting conventions, etc.
So international character sets can be built and deployed with NIO. But if I18N is your thing, you'll probably not deal directly with NIO very often.
 
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic