Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Japanese Text in SQL Server

Status
Not open for further replies.

Bluze

Programmer
Sep 10, 2002
9
0
0
GB
Hi all,

I'm building a site that pulls its content from an SQL Server database, which stores both English and Japanese versions of the content.

I've got it working so that I can store and retrieve japanese text using ASP, and the stored text displays correctly on the web.

However, when I look at the stored data in SQL Server Enterprise manager/SQL Query Analyser, the text is displayed in what looks like ascii characters:

私は日本翻訳を愛する
I think you may need to view source on this page to see - as the html page in this forum is processing the ascii code and displaying the japanese text you probably see above...

The ampersands and hash keys etc make me think that it's storing the text in some kind of web-mode, in the same way that we use ">" for a > or £ for a £

If this is the case, I think I must be doing something wrong - I ideally would like to see the actual Japanese characters in my Enterprise manager - I'm pretty sure I've got the correct fonts installed, as otherwise I wouldn't be able to view it on the web!

I've tried using the unicode prefix N on insert/update, but this doesn't seem to make any difference. The column collation is set to Japanese as well.

Can anyone tell me what I'm doing wrong?

Many thanks,

Bluze
 
Bluze,
I am interested in the answer you might get. I am posting this comment only to get email motification.

Thanks.
 
What was the original text in Japaness? As far as I can see the text in your message is mixed with Japaness and Chinese.
 
It's in Nihongo, I believe - No idea what the English translation is for the text I posted - I just randomly cut and paste from the document I'm working from.

Have you any idea how to get the text looking the same in my SQL Database as it does in the form before I post it?

This ascii code hashkey text is really starting to annoy me - I can't edit directly in the database, as I can't read it!
 
To view Japaness in SQL Enterprise Manager or any other application, you need to change your system codepage. Go to control panel and language setting to set the default to Japaness. After reboot then you will be able to see Japaness.
 
I've tried that already I'm afraid. But it doesn't come up as japanese, just a load of ascii numbers - View the source of my first post, and that's what I see in my database - the web code to display the japanese characters, as opposed to the characters themselves.

What do you think I might be doing wrong on the insert?
 
That is how I got my SQL server manager to work so I'm not sure I fully understand your issue.

Second thought is if the Japaness text that you paste on the first post was from SQL server then I think it is the right string with my limited Japaness knowledge.
 
OK, let me explain my problem more clearly:

I've got a web form in asp that requires the user to type in text in japanese.

The asp then takes that text and inserts/updates to SQL server. When I go into Enterprise manager and have a look at my data, what I typed in as this:

私は日本語を愛する

Is recorded as this:

私は日本語を愛する

Which looks to me like the web way of producing these characters in HTML.

Now, this is a problem for me, as I'd like the text to appear in the database as this:

私は日本語を愛する

This is because I don't want to have to rely on this text being reliant on being read by a web browser that will recognise the ascii characters etc. It's also very difficult to edit from within the database - Japanese is easier to read and edit than ascii - Just!

So, my assumption is that when I insert from the form to the database, somewhere along the way I'm accidently converting the unicode japanese text to ascii. Which I don't want to do.

Does this explain my problem more clearly? Any help is appreciated.

Many thanks,

Bluze
 
I see. You said you had it working in saving and retrieving data from ASP in your first post so that is why it mislead me.

I'm not sure how to solve your problem. It might be converion but can be the data type as well. We use nvarchar for unicode columns (remember to use N'test' in your update SQL).

Good luck.
 
Thanks very much for the help - I'll post up here if I figure it out.

Nice one,

Bluze
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top