Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An Unicode (UTF8 : right arrow ->) validation

 
joshua asem
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An Unicode (UTF8 : right arrow ->) coming from database need to validate at my Java program and replacing it with "blank". Could some give some idea on this. Thanks in advance.

Joshua
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to provide more details, please.
 
Manhar Puri
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can convert the UTF-8 bytes to Unicode as shown below by the pseudo code. The compare it as a string in Java and replace with empty string.

byte[] utf8 = <whatever data is>
// Convert from UTF-8 to Unicode
string = new String(utf8, "UTF-8");


Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic