• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Changing charset from UTF-16 to ISO 8859-1

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm having problems with PostgreSQL that has some major difficulties converting scandinavian UTF-16 characters (ä - a with dots, ö - o with dots) to ISO 8859-1.

----

java.sql.SQLException: ERROR: could not convert UTF-8 character 0x00ef to ISO8859-1

----

^- I think the error above is wrong because java uses UTF-16, right ?

Well anyway, I was thinking that I could go around this problem by making the conversion on the java-side, but have some difficulties understanding the java.nio-package.

So the task is to have the sql-string to include the foobar variable as ISO-8859-1, and the code belove manages not to give the SQLException above, but am I just making a UTF-16 -> ISO 8859-1 -> UTF-16 encoding/decoding there ?

 
I've never won anything before. Not even a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic