473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Encoded chars from form post

Hi,

I have an application that let's the user enter text into a textbox and this
data is collected on the server and stored in a database.
The page is multilingual and sets Response.Charse t to the appropiate for the
language, for example gb2312 for chinese etc. This made all texts on the page
show up alright.

However, I did not change the codepage of the page so ASP encoded the post
data sent to the server and I have got really ugly texts for certain
languages.
I have had applications before doing the same thing where the page has been
able to decode the posted characters again when redisplaying them, but in
this case I haven't been able to get anything meaningful from them.

It seems to me that the encoded text depends on the charset used when
entering the text, entering chinese characters when using iso-8859-1 gives me
character codes like Ó’ which probably would be alright to convert but chinese
text that has been entered in the gb2312 charset look like this

~{OkBrRK<R2zF7~ }

Has anyone any ideas how I can get this back into proper chinese? Any help
would be really appreciated!

Best regards
Fredrik Kronander
Jul 22 '05 #1
3 3800
Hi!

We have an asp application which we are building in unicode support.

What we do is to add codepage=65001 (utf-8) in all asp pages (not in include
files)
<%@ Language=VBScri pt CodePage=65001% >

Then we add a content-header in IIS on the virtual directory we have
Customer header name: Content-Type
Customer header value: text/html; Charset=utf-8

This will force (at least modern browsers like IE, Netscape 6+) to set the
encoding to UTF-8 (which you can see if you right click in the page and
select encoding in IE). The encodings do matters when you post data to the
server. If the encoding for example is Western European and you add a
chinese character into a textbox it will be presented correct (if you have a
unicode font installed) but it will be rubbish when you post the data to the
server. If the encoding is set to utf-8 before you post the data it should
work out for you.

In our application we create the pages dynamically so there is no hardcoded
texts inside the ASP file (so the asp file in itself is not saved in utf-8
format). This may be an issue though if you insert hardcoded texts
(including for example chinese characters) inside the asp file.

We have so far no problems presenting and saving utf-8 encoded data to
Oracle (set up with UTF-8). We can mix swedish, russian, greek, japanese,
chinese in the same text and save and view the data correct. What we have a
bit problems with is to download files where the filename includes for
example swedish characters åäö, japanses or chinese characters (seems to b
characters outside ascii 0-127).

Regards
/Hans
Jul 22 '05 #2
FX
Hi,

Do you have an issue for the filename encoding ? We have the same
problem when we try to URLEncode filename (retreived from a
FileSystemObjec t) that contains special characters like éèà...

thank's

fx

"Hans" <ha***@sorry.no spam.com> a écrit dans le message de news:
uy************* ***@tk2msftngp1 3.phx.gbl...
Hi!

We have an asp application which we are building in unicode support.

What we do is to add codepage=65001 (utf-8) in all asp pages (not in
include
files)
<%@ Language=VBScri pt CodePage=65001% >

Then we add a content-header in IIS on the virtual directory we have
Customer header name: Content-Type
Customer header value: text/html; Charset=utf-8

This will force (at least modern browsers like IE, Netscape 6+) to set the
encoding to UTF-8 (which you can see if you right click in the page and
select encoding in IE). The encodings do matters when you post data to the
server. If the encoding for example is Western European and you add a
chinese character into a textbox it will be presented correct (if you have
a
unicode font installed) but it will be rubbish when you post the data to
the
server. If the encoding is set to utf-8 before you post the data it should
work out for you.

In our application we create the pages dynamically so there is no
hardcoded
texts inside the ASP file (so the asp file in itself is not saved in utf-8
format). This may be an issue though if you insert hardcoded texts
(including for example chinese characters) inside the asp file.

We have so far no problems presenting and saving utf-8 encoded data to
Oracle (set up with UTF-8). We can mix swedish, russian, greek, japanese,
chinese in the same text and save and view the data correct. What we have
a
bit problems with is to download files where the filename includes for
example swedish characters åäö, japanses or chinese characters (seems to b
characters outside ascii 0-127).

Regards
/Hans

Jul 22 '05 #3
Hi Hans and thanks for your reply.

We changed to pure unicode here as soon as we found the problem and the
application works just fine, all data is stored in xmldocuments in the db so
no hardcoded texts anywhere in the ASP page.The posted data now looks just
like it should.

I do however have posted data from before the fix that I would like to
restore to their original state and I have absolutely no clue about how to do
that.

Fredrik
"Hans" wrote:
Hi!

We have an asp application which we are building in unicode support.

What we do is to add codepage=65001 (utf-8) in all asp pages (not in include
files)
<%@ Language=VBScri pt CodePage=65001% >

Then we add a content-header in IIS on the virtual directory we have
Customer header name: Content-Type
Customer header value: text/html; Charset=utf-8

This will force (at least modern browsers like IE, Netscape 6+) to set the
encoding to UTF-8 (which you can see if you right click in the page and
select encoding in IE). The encodings do matters when you post data to the
server. If the encoding for example is Western European and you add a
chinese character into a textbox it will be presented correct (if you have a
unicode font installed) but it will be rubbish when you post the data to the
server. If the encoding is set to utf-8 before you post the data it should
work out for you.

In our application we create the pages dynamically so there is no hardcoded
texts inside the ASP file (so the asp file in itself is not saved in utf-8
format). This may be an issue though if you insert hardcoded texts
(including for example chinese characters) inside the asp file.

We have so far no problems presenting and saving utf-8 encoded data to
Oracle (set up with UTF-8). We can mix swedish, russian, greek, japanese,
chinese in the same text and save and view the data correct. What we have a
bit problems with is to download files where the filename includes for
example swedish characters åäö, japanses or chinese characters (seems to b
characters outside ascii 0-127).

Regards
/Hans

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1227
by: OutsiderJustice | last post by:
Hi, Windows XP has the builtin support for other languages, for example, Chinese, from which I can create a file with the name directly encoded in Chinese, and it's not the unicode (unreadable chars). PHP seems to have problem read such files, my question is how to make it work? I tried some stuff from the utf8_encode/decode manual page and...
8
12736
by: wael | last post by:
hello all, i want convert w_char to UCS2 encoded (0041) this is a char encoded UCS2 please look at this http://www.unicode.org/charts/ http://www.unicode.org/ every language has a chart bye example char 'A' = 0041--> (UCS encoded)
3
5230
by: Supratim | last post by:
Hi, For past few weeks I am working on a function that would take encoded Unicode characters from query string of http requests and then decode them back to Unicode numbers. I have full success with UTF-8 encoding but it is UTF-16 where I stumble. Can somebody help me with one of the following examples that puzzle me : %B7%C9 is UTF-16...
8
4026
by: Eric Lilja | last post by:
Hello, I had what I thought was normal text-file and I needed to locate a string matching a certain pattern in that file and, if found, replace that string. I thought this would be simple but I had problems getting my algorithm to work and in order to help me find the solution I decided to print each line to screen as I read them. Then, to my...
1
2542
by: Kevin | last post by:
I'm using a MagTek check / credit card scanner to scan checks and then submit the check data to NovaInfo through their viaWarp Gateway. The NovaInfo people won't even return my emails, so I'm hoping someone here can help me. The scanner outputs the image in a base64 encoded text string. I'm using the following code to POST the data: ...
1
1851
by: wingsforwheels | last post by:
Prior to posting a form (.asp page) to a URL, I check the parameters being passed and they are not encoded, but when the URL is served it is encoded. How can I prevent this? The code is as follows: <% Response.Buffer = True %> <HTML> <HEAD>
7
2934
by: Ron Garret | last post by:
I'm writing a little HTTP server and need to parse request content that is mime-encoded. All the MIME routines in the Python standard library seem to have been subsumed into the email package, which makes this operation a little awkward. It seems I have to do the following: 1. Extract the content-length header from the HTTP request and...
5
2363
by: sniipe | last post by:
Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string '£ukasz': ${urllib.unquote(c.user.firstName).encode('latin-1')} and I received this information:
0
1518
by: stefcollect | last post by:
Hi all, I am pretty new to PHP and am stuck on - what I think - is a generic string handling problem. I need to read and manipulate some HTML files and have a problem in getting some substrings found even when - it is clear - strings are there. (see a HTML chunk I need to edit at the end of this email). In particular, the following...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.