Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Special character handling in DB2  RSS feed

 
Jagdeep Sharma
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am submitting special character from form to servlet and storing it into database. I am using UTF-8 across the all application (JSP, Servlet and DB2). Everything is working fine but in database this symbol is taking 3 character instead of 1. My database table column type is varchar. My question is that is everything alright here and why this is happening.
 
Phani Raju
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you verified what charset your database is setup with?
 
Jagdeep Sharma
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phani Raju wrote:Have you verified what charset your database is setup with?


Yeah as i mentioned above everything is in UTF-8.
 
Jagdeep Sharma
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jagdeep Sharma wrote:
Phani Raju wrote:Have you verified what charset your database is setup with?


Yeah as i mentioned above everything is in UTF-8.




I mean on JSP i use UTF-8 (in page directive)
servlet - req.setCharacterEncoding("UTF-8")
database has UTF-8 charset.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!