Link to home
Start Free TrialLog in
Avatar of DeepBlueInVB
DeepBlueInVB

asked on

Japanese text gets garbled with enctype="multipart/form-data"

I am having a page with
<form id="frmTest" method="Post" ENCTYPE="multipart/form-data">

so it uses Set Upload = Server.CreateObject("Persits.Upload.1") to access the form elements. and for file uploading.

There is also a field "additional_comments" which is being accessed as :
additional_comments = Upload.Form("additional_comments")

Now the data is saved correctly if entered in English, but if I enter Japanese text it gets garbled by the Upload object and hence is not saved correctly.

I understand that u cannot use Request.Form("additional_comments") along with ENCTYPE="multipart/form-data"..   so how do I save the Japanese comments ??
I am sure this is being done on various Japanese sites..... PLEASE HELP !!!!!
Avatar of masirof
masirof

Try to use
@Codepage = 932 (I think it is 932 for japanese)
Session.LCID = 1041

I am not really sure about numbers, you may have to check.
Hi

when u save details database field corr:to additional_comments must be of type "nvarchar" to support multilanguges..
Also in the query should be

INSERT INTO tableName(id,additional_commentsField) VLAUES (1,N'"& additional_comments & "')

Note 'N' - prefix for nvarchar field

put

<%@ language=vbscript codepage=65001 %>
<meta http-equiv="content-type" content="text/html;charset=utf-8">

in the top


RJ
put this in the comment viewing page

<%@ language=vbscript codepage=65001 %>
<meta http-equiv="content-type" content="text/html;charset=utf-8">

RJ
nchar and nText are also national language suppot data types
Avatar of DeepBlueInVB

ASKER

I have already put the foll at the top

<%@ language=vbscript codepage=65001 %>
<meta http-equiv="content-type" content="text/html;charset=utf-8">


also the database field is indeed nvarchar, but the problem is that the Japanese gets garbled on the form itself (before db update)

I have other pages with similar data, without the file upload part, where the Japanese data gets saved fine, with the codepag and content-type directives put in..

Any ideas guys!!!!
You may try to tell database that a japanese encode type query is to come..
execute this command "set language japanese" just before u insert ur data..
set language japanese,  is not required, like I said, I have other pages (without Upload facility) saving Japanese text just fine !!!!
200 Bonus points, if I get the solution before Monday !!!!
Eheheeh :))) Too few, more :))
Try to put this : <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=SHIFT-JIS">  on both saving and sending pages..
And try unicode too
Try to put this : <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=SHIFT-JIS">  on both saving and sending pages..
 

This has already been done, doesnt work....

what about Unicode ????

and no more points !!!!  500 + 200 bonus (if bfor monday)
:))
Ok, please try to print on the saving page. Do you get data OK?
ok, hold I am trying to figure out..
ASKER CERTIFIED SOLUTION
Avatar of masirof
masirof

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oks shall try this out on Monday....
waiting.. :)
Oks got it by Monday, mucho thanx Masirof

The solution is to put Upload.codepage = 65001, after the CreateObject statement.....  

Just post a comment on the foll question for the 200 points!!!

https://www.experts-exchange.com/questions/21206938/Points-for-Masirof.html
Sorry Masirof, looks like its against the policy !!!!!

=======================
I have deleted this question as it violates the Member Agreement regarding abusing the points system.
A question can have a maximum of 500 points assigned which you allready awarded at http:Q_21201377.html
CetusMOD
Community Support Moderator
=======================
No problem :)