Help: NLS support in Java ?

Help: NLS support in Java ?

Post by Sebastian Szube » Mon, 30 Mar 1998 04:00:00



Hi,

When java prints String (which contains national characters in Unicode
from Oracle thin jdbc driver) to file replaces national characters with
'?'. How can I force my app to convert Unicode characters to iso-8859-2
character set (which contains national characters I need) during
printing ?


        Sebastian.
--

/*
 * Sebastian Szuber, Poznan Supercomputing and Networking Center

 * phone: (+48 61) 8528-503 ext. 266, fax: (+48 61) 8525-954
 *
 */

 
 
 

Help: NLS support in Java ?

Post by Felix Pah » Thu, 02 Apr 1998 04:00:00



> When java prints String (which contains national characters in Unicode
> from Oracle thin jdbc driver) to file replaces national characters with
> '?'. How can I force my app to convert Unicode characters to iso-8859-2
> character set (which contains national characters I need) during
> printing ?

I think in 1.1.x upwards you'd do this by using an
OutputStreamWriter, which translates output according to
encodings. From an earlier post, it seems the encoding
you need would be specified as "8859_2", so you'd need
something like

OutputStreamWriter osw = new OutputStreamWriter
(yourOutputStream,"8859_2");

Then use one of the osw.write (...) methods to print.

HTH,

felix

--
+--------------------------------------------------------+
| Felix Pahl                      Tel.: +44 +1223 351013 |

| Willow House, Conduit Head Road, Cambridge CB3 0EY, UK |
+--------------------------------------------------------+

 
 
 

Help: NLS support in Java ?

Post by Ian Poole » Fri, 03 Apr 1998 04:00:00


Quote:> I think in 1.1.x upwards you'd do this by using an
> OutputStreamWriter, which translates output according to
> encodings. From an earlier post, it seems the encoding
> you need would be specified as "8859_2", so you'd need
> something like

> OutputStreamWriter osw = new OutputStreamWriter
> (yourOutputStream,"8859_2");

> Then use one of the osw.write (...) methods to print.

This is a good way to do it but if you use the Locale class you do not need
to specify an encoding string.

The syntax for this is :-
    Locale.setDefault(new Locale(language,country));
    OutputStreamWriter osw = new OutputStreamWriter(yourOutputStream);

There are a number of static Locale values for a number of
languages/countries. Looking in the documentation of this class for more
information.

--
Ian C. Pooley,

Edward Jones
Information Systems

 
 
 

1. HELP: NLS support for Katakana-Kanji

I am trying to configure Oracle 8 server on NT to support Japanese language.

The documentation regarding the NLS utils does not seem to have anything to
do with what is actually installed with Oracle for NT.

Can anyone illuminate this subject?

Thanx,

--------------------------------------------
Marc Cooperman
Director of Technology
Teleran Technologies, L.P.
(973) 781-9699 x207
http://www.teleran.com

2. A weird installation problem

3. HELP: NLS support of Katakana-Kanji (repost)

4. Stored Procedure: Sequential/Index Search

5. HELP! Need NLS Java API docs/examples

6. AS/400 Passthrough StarSQL

7. MOVE ABSOLUTE num FROM my_cursor

8. updated patch for Chinese NLS support (simplified)

9. Simplified Chinese translation file for nls support

10. PG_DUMP NLS Support (Russian)

11. PSQL NLS Support (Russian)