5

Im having an issue at the moment where my testing environment is not persisting the trademark character "™" in the database. When I enter in the form data, then submit it, I can see that on the server side, the request has the correctly encoded ™ character, but then when the call to hibernate's "saveOrUpdate()" method is called, the data in the table shows up as an upside down question mark.

Im using SqlDeveloper to inspect the table, and I can manually change the character to a ™ by pasting directly into the row then committing, and it works.

So I have made the assumption that hibernates methods of persistence are not working correctly.

Im at a loss here, really, I just dont know what to try, I have set the:

<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">utf-8</property>

properties in the config file, with no luck.

My columns in the tables are NVARCHAR2(400 CHAR) (although they were originally, just VARCHAR2 to start with, but I changed them during the debugging of this issue).

Any help here is greatly appreciated.

Mark

1 Answer 1

5

Ok, so it turns out that what I needed to do was to set the defaultNChar connection property to true.

I did this via the context file for my app in Tomcat.

The article that enlightened me was here.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi MArk, we are not using NCHAR but we are facing issue with Nordic character. They are part of ISO-8859-1. It seems while writing into database it does some magic.
link is now dead... :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.