File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unicode Arabic to \uXXXX

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

How can i convert Unicode Arabic strings to \uAD04 format...

I need this to do a search in the Oracle DB that has Arabic data...

search string is also entered as Arabic characters...

Thanks in advance
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java supports Unicode. Oracle supports Unicode. Why would you need to use the Unicode value at all?
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meaning...I can directly do the transferring in and out ?
 
Paul Clapham
Sheriff
Pie
Posts: 20161
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why a straight Unicode solution shouldn't work. I am surprised you didn't try that first. And I don't see why Oracle's database would interpret Java Unicode escape sequences in the same way the Java compiler would; but I don't know Oracle and stranger things have been done.
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

Answer found out...

UTF-8 can be used straight away...

But there is a trick... request.setCharacterEncoding("UTF-8");

Thanks to Java
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Theepan Thevathasan:
Hi...

Answer found out...

UTF-8 can be used straight away...

But there is a trick... request.setCharacterEncoding("UTF-8");

Thanks to Java


What happens if the client has already set Character Encoding header to some encoding other that utf-8 ?

Even the serlvet specification says that if request.getCharacterEncoding() is null then the client is using Latin-1 code page as charset.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if the client has already set Character Encoding header to some encoding other that utf-8 ?


The encoding would only be something else if the page sent to the browser before wasn't UTF-8, so I don't think this would be a problem.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:


The encoding would only be something else if the page sent to the browser before wasn't UTF-8, so I don't think this would be a problem.


Is this correct to say that if the server sends a resposne with UTF-8 then then the successive requests from the client would also use UTF-8 as character set.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this correct to say that if the server sends a resposne with UTF-8 then then the successive requests from the client would also use UTF-8 as character set.


Not successive requests in general, but requests (links and/or forms) activated from that particular web page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic