Forum Moderators: open

Message Too Old, No Replies

Encoding issues: spaces come out as Å

         

jrthib

11:04 pm on Aug 26, 2006 (gmt 0)

10+ Year Member



Could somebody help me and tell me why all the spaces before quotations and other special characters are coming out as this character "Å". URGENT!

[edited by: jatar_k at 12:07 am (utc) on Aug. 27, 2006]
[edit reason]
[1][edit reason] no urls thanks [/edit]
[/edit][/1]

Robin_reala

11:09 pm on Aug 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is almost certainly an encoding conflict due to one part of your site being UTF-8 and the rest something else, not a CSS issue. Weblink drops aren't allowing on WebmasterWorld as per the TOS, but check that the following three match:

1) Check that the editor you use is saving as UTF-8 (or your choice of encoding)
2) Check that your page's meta elements are set to UTF8 (or your choice on encoding)
3) Check that your server's HTTP Content-Type header is set to UTF-8 (or your choice of encoding)

jrthib

11:29 pm on Aug 26, 2006 (gmt 0)

10+ Year Member



How would i go about fixing this? should i just change all the meta tags to the iso- encoding and the problem will be fixed or is it harder than that?

Sorry, i'm a self taught web designer so excuse my questions if they are stupid. I'm still learning all this html stuff / css / javascript.

Thanks

encyclo

11:45 pm on Aug 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your site content is encoded in UTF-8, but the server is sending a HTTP header declaring the charset ISO-8859-1. Even if you have a meta charset element declaring UTF-8 in the document, you can't override the HTTP header.

This is a server configuration problem - if all your site is encoded as UTF-8 then you can try using a .htaccess file (if you are on an Apache server with the following:

AddDefaultCharset UTF-8

If you use mixed encodings across the site, then try this:

AddDefaultCharset Off

Or edit httpd.conf if you have access to te Apache configuration (ie. on a dedicated server), or speak to the system administrator or your hosting company.

Then either remove your meta charset element or set them to UTF-8 and you'll be OK. :)

jrthib

11:47 pm on Aug 26, 2006 (gmt 0)

10+ Year Member



What if i set all of them to the ISO-8859-1? would that solve it too?

encyclo

11:50 pm on Aug 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What if i set all of them to the ISO-8859-1? would that solve it too?

You would then need to convert the content into ISO-8859-1 encoding rather than UTF-8. Your editor may be able to do this, or you can use the

iconv
utility on the server (if you have command-line access). Just changing the declared charset won't re-encode the pages.

<added> Oh and welcome to WebmasterWorld jrthib! </added>

jrthib

11:55 pm on Aug 26, 2006 (gmt 0)

10+ Year Member



Thanks. Their re-encoding right now. Adobe Golive has a menu where you can convert all the pages in the site to UTF-8 or anything. This whole project i'm doing has been a mess all along. This is a website for a school and their old web designer left them a long time ago. so they've just been adding tape to the website to hold it together basically. I completely redesigned the website for them and fixed it up really nice. I'm going to stick with their original encoding rather than UTF-8 because that was what the original site was encoded as. They people at the school don't know how to configure the server and have no information for me if i wanted to do that so i think ISO-8859-1 would be the safest way. Hopefully it works... I guess i'll know ini about 10 minutes once the upload finishes.

jrthib

12:00 am on Aug 27, 2006 (gmt 0)

10+ Year Member



Still did not work... any ideas?

encyclo

12:04 am on Aug 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check the source code - has your editor really re-encoded the content, or has it switched to entity references for the UTF-8-encoded characters? You may well need to do some global search and replace to correct the characters if the latter has occured.

jrthib

12:07 am on Aug 27, 2006 (gmt 0)

10+ Year Member



how would i know if it encoded it correctly. All the meta tags are changed. Is there something in the code to look for?

you can look at the source code at the link above. its updated to what i just did.

encyclo

12:42 am on Aug 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some editors won't re-encode, they will switch to entity references for non-ASCII characters instead - for example, for the letter  (A circumflex) would be changes to
&Acirc;
. This won't therefore solve your immediate problem.

I'm not familiar with GoLive, but I guess that like most wysiwyg editors there is a global search and replace function that you can use to replace

&Acirc;
with a space or other character as required.

Encoding problems can be difficult to fix, so assuming the editor's configuration and site server configuration are all set to declare one predetermined charset (in your case, you have chosen ISO-8859-1), then once the corrections have been made you should be able to ensure that future content is correctly encoded.

jrthib

12:49 am on Aug 27, 2006 (gmt 0)

10+ Year Member



I found the &Acirc text and i have performed the global search and replaced it with nothing. GoLive only changes the characters to that when it "re-encodes". Thanks for all the help, this forum is great! I hope it will work now. I'm just waiting for the changes to be uploaded. The funny thing is, when i upload the site to my .mac account, everything works fine. but when i upload to the school's hosting it does this.

Thanks for the help!

g1smd

10:22 am on Aug 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Run a few sample pages through [validator.w3.org...] and see what you get.

That test can be very sensitive to content that does not match the stated encoding for the page.