If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Japanese? HELP before I go BALD!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-06, 08:27
manish_jp manish_jp is offline
Registered User
 
Join Date: Mar 2006
Posts: 2
Lightbulb 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 (サオラ マニーシュ test). What am I doing wrong?
Thank you in advance.

- manish panjwani
Reply With Quote
  #2 (permalink)  
Old 03-02-06, 16:33
buzzter66 buzzter66 is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 03-02-06, 22:53
manish_jp manish_jp is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 03-03-06, 01:28
kropes2001 kropes2001 is offline
Registered User
 
Join Date: Nov 2005
Location: Honolulu HI
Posts: 118
i have a friend that uses yahoo and sends me email from japan. that is how her name appears on her email addres.
"(サオラ マニーシュ ーシュ)" <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.GetMySiteOnline.com - Can you help me Get My Site Online ? (Yes. That is EXACTLY what we do.)

http://www.GetMySiteOnline.com/FightingSpam/
__________________________
caeli enarrant gloriam Dei !
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On