This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes An Unicode (UTF8 : right arrow ->) validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "An Unicode (UTF8 : right arrow ->) validation" Watch "An Unicode (UTF8 : right arrow ->) validation" New topic

An Unicode (UTF8 : right arrow ->) validation

joshua asem

Joined: Aug 21, 2008
Posts: 13
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.


Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37884
I think you need to provide more details, please.
Manhar Puri
Ranch Hand

Joined: Aug 23, 2005
Posts: 41
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: An Unicode (UTF8 : right arrow ->) validation
Similar Threads
java String UTF8
UTF vs Unicode (JQ+)
How to store foreign characters from request parameters to beans
unicode value for char
string UTF8