• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Unicode Arabic to \uXXXX

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Meaning...I can directly do the transferring in and out ?
 
Sheriff
Posts: 28346
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
We can walk to school together. And we can both read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic