473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Storing japanese characters

I'm trying to make a site work for japanese characters. It works fine
except for the alerts in javascript.

The characters are stored in unicode, as this;
'コミック全巻配'

Those unicode characters are translated by the browser, but not in the
alert.
Am I storing it correct in the db (コ)? Or should I store the
japanese characters instead of the unicode?
Thanks in advance!
Jul 20 '05 #1
8 10458
Daniel (fa*********@hotmail.com) writes:
I'm trying to make a site work for japanese characters. It works fine
except for the alerts in javascript.

The characters are stored in unicode, as this;
'コミック全巻配'

Those unicode characters are translated by the browser, but not in the
alert.
Am I storing it correct in the db (コ)? Or should I store the
japanese characters instead of the unicode?


It's not really clear to me what you store in the database. Do you store
the string コ in the database? This does not seem like a good thing
to do. You should store the character itself in an nvarchar column.

I don't know Javascript, so I have no idea what is happening there.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
Daniel (fa*********@hotmail.com) writes:
I'm trying to make a site work for japanese characters. It works fine
except for the alerts in javascript.

The characters are stored in unicode, as this;
'コミック全巻配'

Those unicode characters are translated by the browser, but not in the
alert.
Am I storing it correct in the db (コ)? Or should I store the
japanese characters instead of the unicode?


It's not really clear to me what you store in the database. Do you store
the string コ in the database? This does not seem like a good thing
to do. You should store the character itself in an nvarchar column.

I don't know Javascript, so I have no idea what is happening there.


Thanks for your answer.

Yes, I do/did store the string #12467; in the database.

I tried to insert it throught the Enterprise manager (copying from a
japanese site - yahoo.co.jp), but only some squares appears, and they
turn into questionmarks on the site. However, when I copy the squares
and paste somewhere else, the correct japanese characters appears.

So probably it was inserted correctly in the db, but maybe the my
computer and the webserver need to have japanese characters installed?
Jul 20 '05 #3
Daniel (fa*********@hotmail.com) writes:
So probably it was inserted correctly in the db, but maybe the my
computer and the webserver need to have japanese characters installed?


Indeed. Without a Japanese font it's difficult to read Japanese text! (The
web server should not be an issue, though. It only transfers the bytes).

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
Daniel (fa*********@hotmail.com) writes:
So probably it was inserted correctly in the db, but maybe the my
computer and the webserver need to have japanese characters installed?


Indeed. Without a Japanese font it's difficult to read Japanese text! (The
web server should not be an issue, though. It only transfers the bytes).


Thanks for your answer!

Is there anything else I need to do in the database, like set a
collation for this field? I rather wouldn't do that, since it's
suppose to store data from various locales.
I installed japanese characters btw, so it didn't explain the
questionmarks I get on the screen.
I found a solution for my problem with the alert when storing the
codes of the characters (実装), but it seems that storing
the proper japanese characters is the path to take. I mean, '実'
occupies 8 times the space compared to only one character (doesn't
it?).
Jul 20 '05 #5
Daniel (fa*********@hotmail.com) writes:
Thanks for your answer!

Is there anything else I need to do in the database, like set a
collation for this field? I rather wouldn't do that, since it's
suppose to store data from various locales.
You should be using the nvarchar datatype to that. As for the collation,
it matters when comparing and sorting. But doing operations on multi-
lingual data can be immensly complex.
I installed japanese characters btw, so it didn't explain the
questionmarks I get on the screen.


I had some problems in following where you were doing what. But a simple
test is to say:

CREATE TABLE Japanese (a nchar(1) NOT NULL)
go
INSERT Japanese(a) VALUES (nchar(23255))

Then try to display that character in various places.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #6
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
I installed japanese characters btw, so it didn't explain the
questionmarks I get on the screen.

I had some problems in following where you were doing what. But a simple
test is to say:

CREATE TABLE Japanese (a nchar(1) NOT NULL)
go
INSERT Japanese(a) VALUES (nchar(23255))

Then try to display that character in various places.

I inserted it throught the Enterprise Manager before, by copying a
character. I also inserted as you suggested. It looks correct in the
database - it displays as a japanese character.

But on the webpage it only displays questionmarks.

I have installed japanese characters on my computer - not on the
server. I don't think it's installed there. I guess that is the
problem.
Thanks for your help.
/Daniel
Jul 20 '05 #7
Daniel (fa*********@hotmail.com) writes:
I inserted it throught the Enterprise Manager before, by copying a
character. I also inserted as you suggested. It looks correct in the
database - it displays as a japanese character.

But on the webpage it only displays questionmarks.

I have installed japanese characters on my computer - not on the
server. I don't think it's installed there. I guess that is the
problem.


Since "Japanese characters" in this context is a font issue that is
not likely to be the cause. But it could have to do with how the
web page looks like, for instance which character set you have defined
in the HTTP header. There seems to be some character conversion going
on, and the ? is a fallback character for something that cannot be
converted.

Not that I know much about web server, but what web server are you
using, and how to you access the SQL Server from the web server?

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #8
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
Daniel (fa*********@hotmail.com) writes:
I inserted it throught the Enterprise Manager before, by copying a
character. I also inserted as you suggested. It looks correct in the
database - it displays as a japanese character.

But on the webpage it only displays questionmarks.

I have installed japanese characters on my computer - not on the
server. I don't think it's installed there. I guess that is the
problem.


Since "Japanese characters" in this context is a font issue that is
not likely to be the cause. But it could have to do with how the
web page looks like, for instance which character set you have defined
in the HTTP header. There seems to be some character conversion going
on, and the ? is a fallback character for something that cannot be
converted.
e
Not that I know much about web server, but what wb server are you
using, and how to you access the SQL Server from the web server?


I'm using IIS 5.0 and ASP to access the SQL Server.
We found a solution to the problem. It turns out it's necessary to
save the ASP-file converted to utf-8. So now I need to resave ALL the
files..:/

Thanks for your help, Erland!
Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Shelly | last post by:
Hi I am developing a web application for multi language support. But when I view in browser, all languages are shown except Japanese. Do I need to follow some conventions or special settings for...
1
by: Sriv Chakravarthy | last post by:
I am trying to use xerces-c SAX parser to parse japanese characters. I have a <?xml... utf-8> line in the xml file. When the parser encounters the jap characters it throws a UTFDataFormatException....
7
by: Daniel | last post by:
I`m trying to show japanese characters in an alert, like; alert('実装されていませ'); This doesn't work as shown in this post:...
3
by: Mitchell Thomas | last post by:
I recently created a new database in Access 2002. I took data from an access 97 database converted one of the tables to access 2002 and then imported it into a new table in access 2002. but for...
2
by: Joseph | last post by:
Hello. I have this problem. See I have a transformed XML file and I checked its contents prior to outputting it to excel file via responseset. here is the gist of the code: XmlReader reader =...
13
by: mike_dba | last post by:
I am having some data reject on an insert of Japanese characters to a Varchar column in my DB2 UTF-8 database. I am trying to understand how big to make the Varchar column for the inesert to work...
11
by: prats | last post by:
I want to write a GUI application in PYTHON using QT. This application is supposed to take in Japanese characters. I am using PyQt as the wrapper for using QT from python. I am able to take input...
1
by: tony.pahl | last post by:
We are converting a data warehouse to a Unicode database to get ready for multilingual support. If we will have 95% of our data in English as we currently do, and less than 5% in other foreign...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.