Storing Trademark, copyright and Registered symbols in Database.

L

lareds

Hi,

How to store Trademark, copyright or Registered symbols in Database.
I dont have problem displaying them.

This is what I am trying to do. I have a html page. I enter these
symbols in the input box and pass them to servlet.From servlet I store
it in the Database.
When I do this it stores them as some jumbled chars in the database(
when I use
UTF-8 encoding in my HTML page) and '?' ( if I use ISO-8859
encoding).

Iam using java1.3 , windows 2000 and Oracle database.

Any ideas ......
 
S

Shripathi Kamath

lareds said:
Hi,

How to store Trademark, copyright or Registered symbols in Database.
I dont have problem displaying them.

This is what I am trying to do. I have a html page. I enter these
symbols in the input box and pass them to servlet.From servlet I store
it in the Database.
When I do this it stores them as some jumbled chars in the database(
when I use
UTF-8 encoding in my HTML page) and '?' ( if I use ISO-8859
encoding).

Iam using java1.3 , windows 2000 and Oracle database.

Any ideas ......

Have you considered or are you using a suitable datatype such as BINARY or
flavors of the same?

HTH,
 
P

Peter K

lareds said:
How to store Trademark, copyright or Registered symbols in Database.
I dont have problem displaying them.

This is what I am trying to do. I have a html page. I enter these
symbols in the input box and pass them to servlet.From servlet I store
it in the Database.
When I do this it stores them as some jumbled chars in the database(
when I use
UTF-8 encoding in my HTML page) and '?' ( if I use ISO-8859
encoding).

Iam using java1.3 , windows 2000 and Oracle database.

Any ideas ......

Maybe the database can't store those symbols? Maybe it can only store ascii?

Peter
 
L

lareds

Hi,

I am trying it this way....

From HTML I take the value in the Input field and use Javascript
escape() funtion on that value. So for Trademark, I get "u2122".

This is passed to the servlet, and I replace "u2122" with "%99"
and pass it to URLDecoder.decode() to convert it to ascii.

At this point if I print it out, it shows '?'.
Why does this happen. I am using java 1.3, windows 2000.

Note: I noticed that I can directly store these symbols in the
Database, but not through the HTML/Servlet.
 
T

Tor Iver Wilhelmsen

This is passed to the servlet, and I replace "u2122" with "%99"
and pass it to URLDecoder.decode() to convert it to ascii.

That's not ASCII, but CP 1252 which Microsoft calls "Windows ANSI".
Neither ASCII, ISO-Latin-1 or Unicode has a value at hex 99 (dec 153).
In fact, there are no printable values between 128 and 159 (160, or
%A0 is the non-breaking space, character above that value exist in
both ISO-Latin-1 and Unicode).

You need to tell whatever you use to display the char that the
character set used is cp-1252.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top