Results 1 to 2 of 2
  1. #1
    sachin_n is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Default need the help to convert to and from UTF-8 and UCS-2

    Hello,

    I need to process the data which is encoded in UTF-8 and store in database for later use,

    but Since database used is Sql Server 2000 which supports UCS-2 instead of UTF-8. My application is failing to decode and bring the correct result.

    [Note : I can not change the encoding of the database.]

    Please suggest.

    thanks in advance

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    8

    Default

    UCS-2 seems to be standard Java Unicode, so that shouldn't be a problem to get data in and out of the database. If you want to take the data and change it UTF-8, look at the Charset class. You can use the Charset.forName("UTF-8") method to get a UTF-8 object. From this object, you can use encode() and decode() to transform between String and a ByteBuffer.

Similar Threads

  1. convert XML using XSL
    By rajjan4u in forum XML
    Replies: 3
    Last Post: 11-20-2009, 05:37 PM
  2. how to convert xml to xsd
    By adi in forum XML
    Replies: 2
    Last Post: 02-12-2009, 03:43 PM
  3. Convert .java to .exe
    By susan in forum New To Java
    Replies: 6
    Last Post: 02-11-2009, 07:47 AM
  4. Convert java to .exe
    By heartysnowy in forum New To Java
    Replies: 13
    Last Post: 11-21-2008, 09:16 AM
  5. Convert the application from 9i to 10g
    By rahul999 in forum JDBC
    Replies: 5
    Last Post: 09-03-2008, 04:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •