Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Lightbulb Unanswered: Japanese? HELP before I go BALD!

    OK, here's my problem. I have ASP file that has Japanese characters in it. I want to be able to get those characters and put them in MSAccess 2000 database so that they can be retrieved on another asp page.


    After first setting the <%session.codepage=932%> AND setting a header <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=shift_jis">), Yippee, it worked.


    OK, now I want to do this on a regular basis using code. Set everything up,

    copy the characters into the database and WHOOPS! Does not work.


    Here's some code (asp page!):

    Code:
    <% option explicit %>
    
    <HTML>
    <HEAD>
    
    <%
    
        Session.Codepage=932
    
    %>
    
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=shift_jis">
    
    </HEAD>
    
    <BODY>
    
    <%
    
        Dim objFS
        Dim objTS
        Dim objComm
    
    
        set objFS = Server.CreateObject("Scripting.FileSystemObject")
    
        set objComm = Server.CreateObject("ADODB.Command")
    
        objComm.ActiveConnection = <MyConnectionString>
    
        response.write "headline<BR>"
    
        Set objTS = objFS.OpenTextFile(Server.MapPath("/Title.txt"))
    
        InsertItem objTS, "headline", objComm
        objTS.Close
    
        response.write "brief<BR>"
    
        Set objTS = objFS.OpenTextFile(Server.MapPath("/Headline.txt"))
    
        InsertItem objTS, "brief", objComm
        objTS.Close
    
        response.write "body<BR>"
    
        Set objTS = objFS.OpenTextFile(Server.MapPath("/body.txt"))
    
        InsertItem objTS, "body", objComm
        objTS.Close
    
    
        set objComm = nothing
        set objFS = nothing
    
    Private Sub InsertItem(objTS , strField, objComm)
    
        Dim strIn, strInsertString
        Dim strSQL
    
        response.write "Field: " & strField & "==================" & vbCrLf &
    
    vbCrLf
    
        strInsertString = ""
    
        Do While Not objTS.AtEndOfStream
            strIn = cstr(objTS.ReadLine)
            strInsertString = strInsertString & strIn
            response.write strIn
        Loop
    
    
        strSQL = "UPDATE v2_article " & _
                 " SET " & strField & " = N'" & strInsertString & "' " & _
                 " WHERE item_id=51116"
        objComm.CommandText = strSQL
        objComm.Execute
    
    End Sub
    
    %>
    
    </BODY>
    </HTML>
    I get a bunch of JUNK characters in the database. Not Japanese, Not question marks (TI@}j[V@test). What am I doing wrong?
    Thank you in advance.

    - manish panjwani

  2. #2
    Join Date
    Nov 2002
    Location
    Houston, Texas
    Posts
    85

    Have you tried writing back out of the DB?

    Do you have the Japanese Language set installed on your computer? You may need to see if there is something for MS Office that you need to download in order to see the Japanese characters.

    Also, have you tried writing out to an ASP page to see if those "strange" characters are, in fact, some sort of English encoding for the Japanese characters? Based on some of my experiences with Japanese on Windows, I suspect that's what's going on.

  3. #3
    Join Date
    Mar 2006
    Posts
    2
    1. I am using Japanese OS and MSoffice 2k as well.

    2. I am not able to figure out, if those characters are in some english encoding. Do I need to have specific(font or encoding realted) setting in my DB (even if, I am using JP OS and MSOffice)?


    THank you,
    -manish

  4. #4
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    i have a friend that uses yahoo and sends me email from japan. that is how her name appears on her email addres.
    "(TI@}j[V@[V)" <normalEmail@yahoo.com>

    i believe that is encoding, or a code escape sequence to reproduce the Japanese characters.

    is the database you are inserting into on your local machine or is it on a web server someplace ?
    .
    .
    http://www.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

Posting Permissions

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