• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inserting Japanese text into Oracle database

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I apologise if this is not the right forum to ask this question.
I am trying to insert Japanese data retrieved from a JSP page having
"shift-jis" charset into an UTF-8 oracle database.
I am using the following code to get the user input from the Form text box
field as follows:
String textboxString = request.getParameter("japaneseText");
String original = new
String(textboxString.getBytes("8859_1"));
byte[] JISBytes = original.getBytes("Shift_JIS");
String insertToDB = new String(JISBytes, "UTF8");
The string is then inserted in a UTF-8 database
But when the string is retrieved from the database using Java or Perl code,
the result is seen as junk "Mojibake" characters.
Note : When the data is inserted using a Perl script, the data is inserted
properly and the results are also retrieved properly in Japanese characters.
I would appreciate if someone could throw some pointers on this issue. (Even tried this using a servlet )
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good tough question, and yes it does not belong in this forum.
I am going to move this to the Oracle forum.
Mark
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic