473,756 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10511
Daniel (fa*********@ho tmail.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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************** @127.0.0.1>...
Daniel (fa*********@ho tmail.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*********@ho tmail.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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************** @127.0.0.1>...
Daniel (fa*********@ho tmail.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*********@ho tmail.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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #6
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************** @127.0.0.1>...
I installed japanese characters btw, so it didn't explain the
questionmar ks 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*********@ho tmail.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****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #8
Erland Sommarskog <es****@sommars kog.se> wrote in message news:<Xn******* *************** @127.0.0.1>...
Daniel (fa*********@ho tmail.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
1994
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 display in Japanese? Thanks in advance.
1
3167
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. I am quite new to xml and I am not sure how to deal with this situation. Is there a way to parse the jap characters ? or should the japanese characters be escaped in the xml file (i.e. Ӓ) for this to work.
7
5745
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: http://groups.google.com/groups?hl=en&lr=&threadm=F2QCa.15007%24Xl.400929%40twister.rdc-kc.rr.com&rnum=2&prev=/groups%3Fq%3Djapanese%2Balert%26hl%3Den%26lr%3D%26group%3Dcomp.lang.javascript%26selm%3DF2QCa.15007%2524Xl.400929%2540twister.rdc-kc.rr.com%26rnum%3D2 This post implyes that it's possible to use the \uXXXX...
3
1952
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 some strange reason, every once in a while the data changes to Japanese characters, it only happens once in a while, but once it happens that record is lost. i have tried everything compacting, importing to a new database, new table...What is...
2
3700
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 = myEsiCommand.ExecuteXmlReader(); reader.MoveToContent(); string myCSV = reader.ReadInnerXml(); //Load the xml fragment into the document XmlDocument xmlDataDoc = new XmlDocument();
13
13958
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 successfully for all of my data. I would also like ot understand if Vargraphic is a better approach and what ramifications that might have. This data is sourced from UTF-8 Oracle (using byte semantics) which defines a columns as...
11
4766
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 in japanese. But I am unable to display them back to GUI. It displays some junk characters Can anyone suggest me some way how to debug the issue. The code used for tranferring data from view to document is: " codec =...
1
3093
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 languages including Japanese, it appears as if we would be best off using codepage of 1208 and UTF-8. We are thinking we would need to expand our 'char' and 'varchar' datatypes by four times to accommadate the Japanese data. Using 'varchar' should...
0
9455
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9869
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9838
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9708
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.