Forums Register Login

Does any one know a good way to parse in a UTF-8 xml file, store it in ASCII in DB, and export it back to UTF-8 format?

Just to ask the obvious, is there no way to run the DB in Unicode mode, instead of ASCII?

One possibility would be to base-64 encode the string with a library like Jakarta Commons Codec.
[ August 30, 2006: Message edited by: Ulf Dittmer ]

I am not clear but just thinking about following ...

The Reader and writer streams will convert back and forth of UTF format. First write your file into a ByteArrayOutputStream then store it in DB and after reading the data from DB again construct it with Reader.

UTF -----> Writer(Stream); -----> DB

DB ---> Reader(Stream) ---> UTF format

Please correct me If anything wrong.

Thank you.
If you use a standard XML parser and JDBC, isn't encoding taken care of automatically?
I usually base-64 encode it, store in the DB and then decode with:

Thank you all for the helpful info!
bacon. tiny ad:
Thread Boost - a very different sort of advertising

This thread has been viewed 769 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 22, 2018 10:32:08.