Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Special character handling in DB2

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic