Ask a Question related to ASP Database, Design and Development.
-
Scott Vercuski #1
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
Scott Vercuski Guest
-
Multi-Language Site
Hi There, I am developing a site that must be available in multiple languages. How do I make it so that when a visitor clicks on a specific country... -
Multi-language AutoUpdated text fields HELP PLEASE
Hello to all. I'm building a presentation (it's becoming quite big actually), and I want it to work with several languages. I've thought of two... -
multi language - multi track?
hello everybody! im planning an interactive multimedia-cd featuring menues with text, audio and video. this cd will be available for different... -
How Freehand can support multi language?
I want to use freehand to deisgn a product label. The label can display english,chinese and korean. But when i inputy chinese and korean by IME... -
multi language development
Microsoft has a localization toolkit on the MSDN website. I am not sure if it has been updated for .NET Framework 1.1 yet, however:... -
Scott Vercuski #2
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
Scott Vercuski Guest
-
Arnold Shore #3
Re: Multi Language Storage and Display
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" <svercuski@neo.rr.com> wrote in message
news:f40373ba.0310100431.23e0ab0@posting.google.co m...> 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
Arnold Shore Guest
-
Arnold Shore #4
Re: Multi Language Storage and Display
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
Arnold Shore Guest
-
Ross McKay #5
Re: Multi Language Storage and Display
[Follow-ups trimmed to microsoft.public.data.ado]
On 10 Oct 2003 05:31:42 -0700, [email]svercuski@neo.rr.com[/email] (Scott Vercuski)
wrote:
Firstly, I'm assuming you have your character string columns in your>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?
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="vbscript" codepage=65001 %>
<% Response.CharSet = "UTF-8" %>
This allows data pulled from the database to be correctly encoded as
UTF-8 on output. Alternatively, if you use Server.HTMLEncode 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.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = db_conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "your_stored_proc"
Set params = cmd.Parameters
params.Append cmd.CreateParameter(, adVarWChar, adParamInput, _
20, fldTitle)
params.Append cmd.CreateParameter(, adVarWChar, adParamInput, _
60, fldFirstName)
params.Append cmd.CreateParameter(, adVarWChar, adParamInput, _
60, fldLastName)
params.Append cmd.CreateParameter(, adDate, adParamInput, _
, fldReturn_Date)
cmd.Execute , , adCmdStoredProc + adExecuteNoRecords
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
Ross McKay Guest
-
Ross McKay #6
Re: Multi Language Storage and Display
[Follow-ups trimmed to microsoft.public.data.ado]
On 10 Oct 2003 05:31:42 -0700, [email]svercuski@neo.rr.com[/email] (Scott Vercuski)
wrote:
Firstly, I'm assuming you have your character string columns in your>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?
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="vbscript" codepage=65001 %>
<% Response.CharSet = "UTF-8" %>
This allows data pulled from the database to be correctly encoded as
UTF-8 on output. Alternatively, if you use Server.HTMLEncode 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.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = db_conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "your_stored_proc"
Set params = cmd.Parameters
params.Append cmd.CreateParameter(, adVarWChar, adParamInput, _
20, fldTitle)
params.Append cmd.CreateParameter(, adVarWChar, adParamInput, _
60, fldFirstName)
params.Append cmd.CreateParameter(, adVarWChar, adParamInput, _
60, fldLastName)
params.Append cmd.CreateParameter(, adDate, adParamInput, _
, fldReturn_Date)
cmd.Execute , , adCmdStoredProc + adExecuteNoRecords
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
Ross McKay Guest
-
Jerry III #7
Re: Multi Language Storage and Display
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" <svercuski@neo.rr.com> wrote in message
news:f40373ba.0310100431.23e0ab0@posting.google.co m...> 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
Jerry III Guest
-
Jerry III #8
Re: Multi Language Storage and Display
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" <svercuski@neo.rr.com> wrote in message
news:f40373ba.0310100431.23e0ab0@posting.google.co m...> 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
Jerry III Guest



Reply With Quote

