JPA Mapping
I'm Using JPA with Hibernate. I have an entity with a @Lob property
@Column(nullable=false)
@Lob
private String text;
I'm using PostgreSQL 8.4 and the Entity was correctly mapped with the column
"text" text NOT NULL
My view pages are using UTF-8 encoding and my URL Connection is also using the proper encoding:
<property name="url" value="jdbc:postgresql://myhostip:port/mydb?useUnicode=yes&characterEncoding=UTF-8" />
Also, my client_encoding on posgreSQL is Unicode (using Query Tool) or UTF-8 (using psql).
The problem
Although I can read/persist the data, when I display it there are some encoding problems like showing ��.
Another information is, on the same entity I have another String properties there are displayed correctly for the same content of the @Lob property.
I have also exported the text property from psql to a test.txt file and the content is ok.
I've tested the value of the property just before persisting (debugging) and the value is correct.
charSet=UTF-8
(for 8.4 too) – Hines