Bug or wrong usage of UTF-8 encoding?

Found a bug? Tell us!!
Post Reply
Walter

Bug or wrong usage of UTF-8 encoding?

Post by Walter »

Hi there,

I want to set up a blog-website for a taiwanese podcaster and was very happy to see that s9y 0.9 comes with utf-8 encoding which should make life easier because there will be chinese- and english-speaking administrators. So i downloaded the nightly snapshot of today.

But then I saw that each file within the serendipity folder, even the language files and templates themselves, are still ISO-8859-1 encoded. Only the special characters within these files seem to have been converted.

So the problem is: I open up the chinese language file but instead of seeing the properly UTF-8 encoded chinese words and sentences, I see scrambled ISO-8859-1 characters.

So, why is that? :?:
Am I making a mistake here?
Or is it a wrong usage of file encodings?

Thanks a lot for your help!!
Walter
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Bug or wrong usage of UTF-8 encoding?

Post by garvinhicking »

The language directories have a "UTF-8" subdirectory where you can see the right files.

Since the templates and our core development files do not contain High-Ascii characters, those do not need to be encoded in any charset.

Did you go to your s9y blog configuration and choose the UTF-8 charset? This is of course required - it all should work, so it should currently only be a config issue!

What's the URL to your blog?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Walter

Post by Walter »

Hello,

thanks for the quick response!
The configuration is okay, I think I found the source of error:

I don't know why, but my editor (BBEdit on Mac) isn't able to auto-detect the encoding of these files and opens them with the standard encoding which is currently -you guessed it- ISO-8859-1. When I manually open the files as UTF-8, everything works as supposed.

I tested some other files with BBEdit and each one of them was auto-detected properly, so don't ask me why BBEdit refuses s9y files. :wink:

The blog isn't online yet, but I will add it to the "Who is using s9y" list as soon as it is available.

Thanks again,
Walter
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hm, that's very strange then. Indeed s9y does not contain the magic BOM for UTF-8 files - but that's because PHP files tend to cause trouble if they contain those extra padding inside the file.

Sadly I don't have a Mac to work with BBEdit, so I don't exactly know how to change that behaviour :)

Have fun,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Walter

Post by Walter »

I just changed the default encoding to UTF-8...
That should do it for now...

BTW: http://www.apple.com/de/switch/ :mrgreen:

Bye,
Walter
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

I have my Smultron's default encoding set to UTF-8 from long time ago to
avoid this sort of issue. Seems if you just have the 'bare' text files these
Mac editors don't seem to quite 'get' what encoding it's in. Meh...

I still don't see the appeal of BBEdit... Smultron is freeware and powerful
enough that I do all my s9y plugin creation and editing from there. Just my
two cents. :wink:
I make s9y plugins, too.
My s9y blog depends on them. :)
Walter

Encoding Detection

Post by Walter »

I just wanted to tell, that Smultron ist really a great editor.
Thanks for the tip!

And: Finally, the blog I was talking about is online: http://www.princessremy.net/ (Mandarin Chinese)

It's a blog of a female taiwanese Podcaster, living in Austria, talking and writing about cultural differences. Unfortunately, I don't understand mandarin chinese. :wink:

I added the link to "Who's using S9Y" to China and Taiwan.

Bye,
Walter
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Re: Encoding Detection

Post by wesley »

Walter wrote:I just wanted to tell, that Smultron ist really a great editor.
Rather than being vague, is there something I should know about?
I make s9y plugins, too.
My s9y blog depends on them. :)
Walter

Post by Walter »

wesley wrote:Rather than being vague, is there something I should know about?
What do you mean?
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Walter wrote:
wesley wrote:Rather than being vague, is there something I should know about?
What do you mean?
Such as, features missing in Smultron that I might find useful in the editor
you use (BBEdit, was it?). I really just skimped around when choosing
editors and BBEdit didn't give me a very good first impression and sort of
threw it out the window after a few tries.
I make s9y plugins, too.
My s9y blog depends on them. :)
Post Reply