Locale-Sensitive Java Method
public OutputStream getLocalizedOutputStream(OutputStream out)
Internationalization (I18n) Method Overview
Creates what Sun's deprecated Javadocs refer to as a localized version
of an input stream. This method takes an OutputStream and returns an
OutputStream equivalent to the argument in all respects except that
as Unicode characters are written to the stream,
they are automatically converted to the local character set.
Internationalization problems arise through use of this method when the local (machine)
character encoding is not the desired character encoding. Further,
it is a recommended I18n practice to always use a Unicode character encoding
to ensure that the output encoding can properly represent any characters that
the program might attempt to write. Use of the default encoding does not
ensure support of characters from any locale.
public OutputStreamWriter(OutputStream out,
//Instantiate the output stream here by
//opening an output stream on a file, etc. ...
Runtime rt = Runtime.getRuntime();
OutputStream new = rt.getLocalizedOutputStream(in);
//instantiate the OutputStream here ...
OutputStreamWriter writer = new OutputStreamWriter(
Locale-Sensitive Java Methods