Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Changing charset from UTF-16 to ISO 8859-1

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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 ?

 
reply
    Bookmark Topic Watch Topic
  • New Topic