• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Character encoding problems

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I'm having problems I'd like some help with.

We have a java framework using Tibco libraries in order to receive requests from different clients. One of the services we provide involves a Tibco request/reply message sent to an LDAP server where the response may contain fields which in turn may contain non ASCII characters such as swedish Ä, Å & Ö
The LDAP server is sending the response with ISO8859-1 encoding while the JVM our services runs in is Linux server default - which is UTF-8.
The problem now is that I find it difficult (impossible so far) to transform the String fields in LDAP response into UTF-8 equivalents
When I startup JVM with ISO8859-1 default char encoding everything goes well as expected but this is not an opt due to other - and they are by far a greater number - services will break if we don't run JVM with UTF-8...

As it is with Tibco rv responses, the content of the response message fields arrives as Objects and there are methods in Tib libraries letting us retrieve separate fields as String, Int32 etc etc...
I have tried different approaches including java.nio.charset.Encoder/Decoder and also serializing of the field content (while still Objects) - in order to avoid making them into strings with the UTF-8 server default encoding - using ObjectOutputStream/ByteArrayOutputStream but still no luck.
My best guess is that I should go with the java.nio package methods but I'm not really an expert on how to sue them

Not seeing my code I guess it may be hard to come up with advices, but maybe someone has some general advice on how to approach this scenario where incoming data is in ISO-8859-1 and this data needs to be received and processed with UTF-8 encoding
By the way, we are using Java 1.6 & 1.7 (different environments but 1.7 is the main version we need to have the solution for)
Regards
/R
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic