INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Convert ISO-8859-1 to utf-8

Convert ISO-8859-1 to utf-8

(OP)
After hours of searching I have decided I perhaps should use Tek-Tips to hopefuly find an answer to this.

I have an XML file that is encoded in ISO-8859-1. When I open this in a browser everything is fine. In particular £(GBP signs) which is my main concern.

When I load the xml page via an ASP script and view the contents all of the "£" signs have changed to "�" as well as some other special characters.

How do I get these characters to display correctly. I also need to enter them into a database.

I have had this issue many times over the years but it has been solved by making sure all pages are set to utf-8. What can I do to change the ISO-8859-1 encoding to UTF-8 after the XML file has been loaded.

I have tried programmatically changing the encoding of the XML file to utf-8 but this gives me the a question mark in a black diamond instead of the correct characters.

Thanks in advance for any help on this issue

Web Development Manager
http://www.freemoneyoff.co.uk
http://www.freemoneysurveys.co.uk
http://www.free-money-resource.com

RE: Convert ISO-8859-1 to utf-8

Why not give resulting document URL a UTF-8 CharSet header?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Convert ISO-8859-1 to utf-8

Quote:

I have an XML file that is encoded in ISO-8859-1.
Interesting.

Quote:

When I load the xml page via an ASP script and view the contents all of the "£" signs have changed to "�" as well as some other special characters.
Sounds more like UTF-8 not correctly interpreted.
Is the XML truly ISO 8859-1 encoded? Open it in Notepad++ and click the "encoding" menu item. Does it say ANSI?

Quote:

What can I do to change the ISO-8859-1 encoding to UTF-8 after the XML file has been loaded.
What you can do is set the ASP session encoding to UTF-8:

CODE

Session.CodePage=65001 
Then, of course, the encoding of your XML must be utf-8 too. If you open it in Notepad++ you can click "Encoding->Convert to UTF-8 without BOM".

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: Convert ISO-8859-1 to utf-8

(OP)
I have opened it in Notepad++ but nothing is selected in the encoding menu. When converting it to UTF-8 without BOM it works.

Of course the problem is that I need all of this automated, in other words I do not want to download the XML file, convert it in Notepadd++, upload the XML file, then run the script.

Is there anything I can do to convert it via a script?

Web Development Manager
http://www.freemoneyoff.co.uk
http://www.freemoneysurveys.co.uk
http://www.free-money-resource.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close