-
Javascript problem with document.write and accented characters
Hi,
I have a web page where I put a javascript and where its source is an ASP.NET application. So it looks like this:
<script language="javascript" src="/js.aspx type="text/javascript"></script>
This web page has the meta tag for encoding:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
The ASP page is printing some document.write with data taken from a database. If I go directly to the js.aspx page, I see this:
document.write('Mon père a été là');
The french accent are there which is good.
But when I go to my test page, I see things like this:
"Mon père a ètè lè"
All the french accent have been converted in a non-readable format.
I tried to put the charset property to the script tag (charset="iso_8859-1") and it doesn't work. I also check encoding of my ASP page but it still doesn't work.
After googling a lot in vain, I hope I'm not the only having this problem!
Any idea or any solution??
Thanks!
Stephane
-
I don't think you can have anything but a .js file as the src of a script tag that has javascript as it's type. Also you're missing 2 closing quotes.
-
Hi,
I've done this a few times with PHP and ASP pages and I didn't have any trouble. But this time with ASPX page, there's a problem with the encoding somewhere... Is there a way to dynamically convert accented charaters using javascript or .net??
Thanks
Stephane
-
I've done a lot of things and it's working now... I'm not 100% sure but it seems it's because I added responseEncoding="iso-8859-1" to the ASP.Net Page directive.
It works now so I won't touch it again!
Steph
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|