473,581 Members | 3,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multi Language Storage and Display

Hello All,

I'm having a problem saving/displaying multiple lanaguages on an
ASP page. Here's the general problem I'm having. I have an admin
area of a website that allows a user to enter items in multiple
languages. EX:

NAME LANGUAGE
Trade Show English
商业展览 Chinese
Торговая
выставка Russian

When I store and display the chinese and Russian text I'm using an
update statement as follows.

UPDATE TABLE SET NAME =
N'Торговая
выставка' WHERE LANG =
'RU'

When I read that text out of the database and try to display it, it
just comes up as garbage. If I change my browser encoding to Unicode
(UTF-8) it still comes up as garbage. My question is, how can I get
multiple languages to display on one page?

Thanks in advance for any assistance.
Scott Vercuski
Jul 19 '05 #1
4 4557
I'm using the familiar meta: <META HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=UTF-8">, and storing/pulling text into/from an
Access db. I haven't seen the need to use the entities you show.

AS

"Scott Vercuski" <sv*******@neo. rr.com> wrote in message
news:f4******** *************** **@posting.goog le.com...
Hello All,

I'm having a problem saving/displaying multiple lanaguages on an
ASP page. Here's the general problem I'm having. I have an admin
area of a website that allows a user to enter items in multiple
languages. EX:

NAME LANGUAGE
Trade Show English
商业展览 Chinese
Торговая
выставка Russian

When I store and display the chinese and Russian text I'm using an
update statement as follows.

UPDATE TABLE SET NAME =
N'Торговая
выставка' WHERE LANG =
'RU'

When I read that text out of the database and try to display it, it
just comes up as garbage. If I change my browser encoding to Unicode
(UTF-8) it still comes up as garbage. My question is, how can I get
multiple languages to display on one page?

Thanks in advance for any assistance.
Scott Vercuski

Jul 19 '05 #2
I should have mentioned that I'm doing UTF-8 for Russian/Cyrillic, Arabic,
Hebrew, and the CJK languages as well as English and the Europeans. FWIW.

AS
Jul 19 '05 #3
[Follow-ups trimmed to microsoft.publi c.data.ado]

On 10 Oct 2003 05:31:42 -0700, sv*******@neo.r r.com (Scott Vercuski)
wrote:
Hello All,

I'm having a problem saving/displaying multiple lanaguages on an
ASP page. Here's the general problem I'm having. I have an admin
area of a website that allows a user to enter items in multiple
languages. EX:

NAME LANGUAGE
Trade Show English
商业展览 Chinese
Торговая
выставка Russian

When I store and display the chinese and Russian text I'm using an
update statement as follows.

UPDATE TABLE SET NAME =
N'Торговая
выставка' WHERE LANG =
'RU'

When I read that text out of the database and try to display it, it
just comes up as garbage. If I change my browser encoding to Unicode
(UTF-8) it still comes up as garbage. My question is, how can I get
multiple languages to display on one page?


Firstly, I'm assuming you have your character string columns in your
database as type NVARCHAR, so that they can accommodate Unicode strings.

Next, you should be running on Windows 2000 or XP, so that you are using
IIS 5.0 or higher. You can do this on NT4 with IIS 4.0, but there are
more hoops to jump - it's just not worth it.

When retrieving date from the database to display on the ASP page, you
need to set the CodePage and the CharSet, as follows (example is UTF-8):

<%@ language="vbscr ipt" codepage=65001 %>
<% Response.CharSe t = "UTF-8" %>

This allows data pulled from the database to be correctly encoded as
UTF-8 on output. Alternatively, if you use Server.HTMLEnco de it will
give you HTML encoded versions, like in you example text above (but of
course, your page download size will increase).

For saving your data back to the database, which I presume is SQL Server
given the list of groups you cross-posted to, write a stored procedure
to do the work and use the Parameters collection of the ADO Command
object to set the values. Specify adVarWChar as data type.

Set cmd = Server.CreateOb ject("ADODB.Com mand")
Set cmd.ActiveConne ction = db_conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "your_stored_pr oc"
Set params = cmd.Parameters

params.Append cmd.CreateParam eter(, adVarWChar, adParamInput, _
20, fldTitle)

params.Append cmd.CreateParam eter(, adVarWChar, adParamInput, _
60, fldFirstName)

params.Append cmd.CreateParam eter(, adVarWChar, adParamInput, _
60, fldLastName)

params.Append cmd.CreateParam eter(, adDate, adParamInput, _
, fldReturn_Date)

cmd.Execute , , adCmdStoredProc + adExecuteNoReco rds

Works for me.

regards,
Ross.
--
Ross McKay, WebAware Pty Ltd
"Words can only hurt if you try to read them. Don't play their game" - Zoolander
Jul 19 '05 #4
If you're storing the data as HTML entities (and you are) you don't need the
data type to be a Unicode string as entities will only have standard ASCII
characters. Second, take a look at the page source (i.e. the HTML you're
generating). If that looks ok (there actually is
商业展览 for the Chinese version) then you need to
set your browser to use a font that actually has the characters you're
trying to display. It does not matter what the encoding is since your output
is going to be only 7-bit ASCII.

To make it short - the first step is to check the page source and see what's
in there. Let us know.

Jerry

"Scott Vercuski" <sv*******@neo. rr.com> wrote in message
news:f4******** *************** **@posting.goog le.com...
Hello All,

I'm having a problem saving/displaying multiple lanaguages on an
ASP page. Here's the general problem I'm having. I have an admin
area of a website that allows a user to enter items in multiple
languages. EX:

NAME LANGUAGE
Trade Show English
商业展览 Chinese
Торговая
выставка Russian

When I store and display the chinese and Russian text I'm using an
update statement as follows.

UPDATE TABLE SET NAME =
N'Торговая
выставка' WHERE LANG =
'RU'

When I read that text out of the database and try to display it, it
just comes up as garbage. If I change my browser encoding to Unicode
(UTF-8) it still comes up as garbage. My question is, how can I get
multiple languages to display on one page?

Thanks in advance for any assistance.
Scott Vercuski

Jul 19 '05 #5

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

Similar topics

2
1787
by: John Pollins | last post by:
Greetings, We are trying to set up a set of "Leading Practices" for our developers, as well as ourselves, and hope some gentle reader can recommend some documentation in favor of what appears to be the right position to take. We do not allow third party applications to run on our SQL Servers. We want to include DTS Packages under the...
72
5367
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools (dreamweaver and the like), they are all at the lowest level of programming (something like assembly as oposed to C++ etc.). These tools create...
11
4442
by: truckaxle | last post by:
I am trying to pass a slice from a larger 2-dimensional array to a function that will work on a smaller region of the array space. The code below is a distillation of what I am trying to accomplish. // - - - - - - - - begin code - - - - - - - typedef int sm_t; typedef int bg_t; sm_t sm; bg_t bg;
7
1340
by: Bart Schelkens | last post by:
Hi, what is the best way (or the most interesting) way to make my application multi-lingual? I have french, dutch and english users and they all want the menu's and the labels,... in their language. Thx.
2
3253
by: Juuso Hukkanen | last post by:
I need a list of multithreading unsafe C (C99) functions/features. comp.programming.threads provided an initial list of C:ish functions, with following ANSI C functions: asctime, gmtime, localtime, ctime, tmpnam, strtok http://www.lambdacs.com/cpt/FAQ.html#Q150 However, extra Googling hinted rand() and srand(), also being unsuitable...
6
4535
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a good question for you. Our company would like to display Chinese(either simplifiled or traditional version) for all field labels on any asp page, but customers can enter text/data in English with any fields. My question is: do I have to make another copy of the program and just change the field label from English to Chinese...
17
10636
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when talking with another team -- codepage -- at the same time. I am more confused when I saw sometimes we need codepage parameter for wide character...
2
4649
by: Aussie Rules | last post by:
Hi, I have a site that Iwant to either display my text in english or french, based on the users prefernces ? I am new to webforms, but I know in winforms, this is pretty easy with a resource file. What is the best way to acheive this with webforms ?
4
4173
by: LouiseR | last post by:
I just recently tried to use a multi-row insert on a table that contains a timestamp column, but I get SQLCODE -180 even though I'm positive that the value that I'm trying to insert is correct. The error message is : " THE DATE, TIME, OR TIMESTAMP VALUE *N IS INVALID". Any ideas?
0
7886
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...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8312
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...
1
7920
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...
0
8183
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...
0
5366
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...
0
3809
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...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.