• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Passing MultiLingual characters from a jsp

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set the charset to "utf-8" in my jsp to take characters of any language. When i pass these to a servlet and make a call to the database, the characters/string is not stored in its original form, but in its ASCII notation and the database goes for a toss in this situation.
Eg: If my database field is of length 10 and i want to enter multi-lingual characters, then each character will take 2 bytes instead of one, i.e. a string of length 5 only can be stored in such a field. But because in this case the ASCII notation is going to the database. The length of one character in ASCII notation is 8 bytes and hence it does not store for more than 1 character when it could have stored atleast 5.
I am entering '��' (a japanese character) in the jsp, it is being stored as 'か' in the database which is its ASCII notation and not as '��'. The actual length of this character '��' is just 2 bytes, though because the ASCII is going in the database ('か') whose length becomes 8 bytes.
Please tell me how to resolve this so that the value entered in the database is not its ASCII notation but its actual value.
Regards,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic