utf8 encoding problems...please help.

F

FX

Hi,

my ASP script page must be in utf8 for internationalization problem. Here is
the asp configuration:
- @Codepage=65001 or Session.CodePage=65001
- Response.charSet="utf-8"

But I have many coding problems with utf-8:
- can't use éàè... characters in javascript comments because ASP files
must be saved in ANSI format
- must save my included javascript file in UTF-8 cause of special
characters in comments (french attitude...)
- can't use standard upload components (free components like
aspSmartUpload understands UTF8 Upload with special characters but not the
aspSmartUpload Request object to retreive other <Form> values )
- For Each syntax in multivalued Request object doesn't work (the
variant seems to be an ANSI encoded character). Ex: For Each foo in
request("Foo") => foo contains wrong encoded characters (not UTF-8)
- AND SO ON....

Is there a simple way to develop utf-8 compliant ASP webapplication ?
Where can I get exhaustive rules to develop ASP web application in utf-8
charset ?

regards,

FX
 
J

J. Baute

FX said:
Hi,

my ASP script page must be in utf8 for internationalization problem. Here is
the asp configuration:
- @Codepage=65001 or Session.CodePage=65001
- Response.charSet="utf-8"

But I have many coding problems with utf-8:
- can't use éàè... characters in javascript comments because ASP files
must be saved in ANSI format
- must save my included javascript file in UTF-8 cause of special
characters in comments (french attitude...)
- can't use standard upload components (free components like
aspSmartUpload understands UTF8 Upload with special characters but not the
aspSmartUpload Request object to retreive other <Form> values )
- For Each syntax in multivalued Request object doesn't work (the
variant seems to be an ANSI encoded character). Ex: For Each foo in
request("Foo") => foo contains wrong encoded characters (not UTF-8)
- AND SO ON....

Is there a simple way to develop utf-8 compliant ASP webapplication ?
Where can I get exhaustive rules to develop ASP web application in utf-8
charset ?

regards,

FX

Unfortunately I don't there there's an easy way of making an ASP app
Unicode/UTF-8 complaint. I've been looking into the matter myself the
last few days now, and I've seen a lot of issues already just testing
a few things out.
So this thread will definatly be one I'll be keeping an eye on.

A few things I might be able to help with though:

first, Interdev saves your ASP pages using UTF-8 encoding as soon as
you add the content-type meta tag in your page (<meta
http-equiv="Content-Type" content="text/html; charset=utf-8">).
Unfortunately I don't know how to do this if the page contains no
HTML, like for JavaScript include files, or plain ASP files containing
no HTML code.

But using notepad you can always use the "Save as" feature and then
select UTF-8 as th eformat to save the file in for those files. It
could be that Interdev changes the format back to ANSI though
afterwards when edited, I haven't tried that out yet.


on the Request object I've read that using it's default collection can
cause problems with the special characters, so you should use
Request.Form or Request.QueryString at all times.

Server.HTMLEncode is supposed to have simular issues
(http://support.microsoft.com/?kbid=259352), but since the MSDN
article is talking about ASP 2.0 and not 3.0, and I haven't managed to
simulate this problem yet, I think it might not be an issue anymore.


hope this helps,
J.
 
F

FX

first, Interdev saves your ASP pages using UTF-8 encoding as soon as
you add the content-type meta tag in your page (<meta
http-equiv="Content-Type" content="text/html; charset=utf-8">).
Unfortunately I don't know how to do this if the page contains no
HTML, like for JavaScript include files, or plain ASP files containing
no HTML code.
You can do a Save As in Interdev for javascript included file, and choose
UTF8 text format.
on the Request object I've read that using it's default collection can
cause problems with the special characters, so you should use
Request.Form or Request.QueryString at all times.
You can replace the syntax:
For Each foo in Request("foo")
Response.Write foo
Next

by

For i=1 to Request("foo").Count
Response.Write Request.Item(i)
Next

it works fine.
hope this helps,
J.

thanks
 
M

MK

We're struggling with a possibly related issue.

We have UTF-8 include files in our application. These appear to be affecting
INPUT statements on pages that contain no UTF-8 characters (and are using
Latin codepages/charsets).

With the UTF-8 include files removed Request.Form("string") returns high
ASCII characters as used in French, German languages etc.

But with a UTF-8 include file added these characters disappear (even though
nothing in the UTF-8 include file is used).

You can see them if you just do a:

Response.Write Request.Form

But now a:

Response.Write Request.Form("string")

Neither do they show if you use Key, Item etc.


MK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top