Re: Encoding conversion problem



Hi Lew,

I uinderstand my confusion now - it stemmed from the phrase "the encoding of
the JVM". The JVM itself only uses one encoding; it translates to and from
other encoding on I/O. So to make sure I understood you correctly, were you
referring to the encoding specified by the I/O call?
Maybe I don't understand :-(
In my posts I tried to specify the encoding of the DBMS and the JVM
encoding (i.e. the system property file.encoding) in the different
cases and, as you stated, the JVM performs the necessary translations.
In my JDBC calls I don't specify/force any encoding.


Generally if the encoding you specify for I/O is different from the encoding
in your data store, it will cause trouble. This is not limited to Java. Over
in the Postgres newsgroups one finds people have trouble with character
encoding from all sorts of platforms, mostly stemming from trying to store
characters in a column that are not part of the specified character encoding
for the DB. If such things don't match, then problems will hatch.
I disagree...
For our application we keep the DBMS with a fixed encoding and the
application performs the necessary conversions. For instance for
polish installations we use an ISO-8859-1 database and an application
server configured with ISO-8859-2 where we store polish characters
without problems.

Andrea
.



Relevant Pages

  • Re: Encoding conversion problem
    ... characters outside the encoding of the JVM, ... character is representable in the JVM, ... Generally if the encoding you specify for I/O is different from the encoding in your data store, ...
    (comp.lang.java.databases)
  • Re: how can I get the text files encode?
    ... As both of you say,there is not way to determine which encode the file ... When you ask for a stream to be read as ... use the encoding to convert the bytes to Unicode characters. ... the JVM just does what you tell it. ...
    (comp.lang.java.programmer)
  • Re: Encoding conversion problem
    ... The JVM itself only uses one encoding; ... In my posts I tried to specify the encoding of the DBMS and the JVM ... characters in a column that are not part of the specified character encoding ...
    (comp.lang.java.databases)
  • Re: Writer doesnt write out =?UTF-8?B?IuKJpCIgY2hhcmFjdGVyIHBybw==?= =?UTF-8?B?cGVybHk=?=
    ... FileWriter picks up whatever encoding the machine happens to be configured with at the time the JVM started. ... I strongly suggest using FileOutputStream and OutputStreamWriter specifying an explicit character set. ...
    (comp.lang.java.programmer)
  • Re: Test to see of a variable has been used/initialised
    ... >>The Java virtual machine specification does not mandate a concrete value ... >>encoding null. ... >>interpret that to mean it can be anything the JVM author wishes it to be. ...
    (comp.lang.java.programmer)