Multi Language Storage and Display

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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:...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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:
    >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="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

  7. #6

    Default 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:
    >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="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

  8. #7

    Default 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

  9. #8

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139