Is LT changing my encoding?

Is LT changing my encoding?

Postby Sarit on Sun Nov 27, 2005 4:48 pm

{whispering to herself: "I know I'm not crazy.. I know I'm not crazy.." }

I've set up the encoding type for Hebrew as UTF8, like so:
Code: Select all
$messages['encoding'] = 'UTF8';

The document was saved in UTF8 format, my database is now officialy UTF8 encoded, I'm sorrounded by UTF8!

However, when I try using the Hebrew locale, I keep getting this message right above my pages (login and admin pages):

Code: Select all
Exception message: Cannot modify header information - headers already sent by (output started at /home/public_html/circle/locale/locale_he_IL.php:1)
Error code: 2
-- Backtrace --
/home/public_html/circle/class/view/view.class.php(172): header
/home/public_html/circle/class/view/view.class.php(309): adminnewpostview.sendcontenttype
/home/public_html/circle/class/view/admin/adminview.class.php(106): view.render
/home/public_html/circle/class/view/admin/admintemplatedview.class.php(36): adminview.render
/home/public_html/circle/class/view/admin/adminnewpostview.class.php(66): admintemplatedview.render
/home/public_html/circle/class/controller/controller.class.php(325): adminnewpostview.render
/home/public_html/circle/admin.php(39): admincontroller.process


When I viewed the source of the login page, I noticed it's encoded UTF8.
When I viewed the source of my admin pages and my blog pages, they're encoded
Code: Select all
charset=iso-8859-1"


Where is this one (iso-8859-1) coming from? Is this my problem with the Hebrew encoding? Because I know the language file is perfect. Nothing wrong with it.
Arrrgggg. I'm going crazy :(

[edit] By the way, the reason I'm insisting over UTF8 for Hebrew so much, is because it would be the right thing to do. Working with a different encoding saves data in the dbs in an old Hebrew encoding type and so a draft's text or a commenter's deatails are retrived back as a bunch of question marks. I can't have that for my visitors :( [/edit]

Sarit
Sarit
 
Posts: 63
Joined: Sat Sep 10, 2005 7:05 am

Postby phunkphorce on Mon Nov 28, 2005 1:34 am

I think somebody already answered to this problem: your UTF-8 editor is leaving something called the BOM (byte order mark) in the beginning of the file. You probably don't see it because editors hide that from you, but if you edit your file with something like Windows' notepad or other "raw" editor, you'll see two bytes looking like gibberish in the beginning of the file, *before* the <?php mark. You must remove that in order to remove the warning that php is throwing, because it is actually outputting those before processing anything.

Regarding the other problem with the encoding, all templates select their encoding dynamically by calling {$locale->getCharset()} at the top of header.template. What template are you using? At leas the admin templates and all other templates distributed with the basic package have something like this:

Code: Select all
<meta http-equiv="content-type" content="text/html;charset={$locale->getCharset()}" />
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby Sarit on Mon Nov 28, 2005 2:53 am

Can I send someone my locale file, to run it on your own editor and see if I'm missing anything?
Sarit
 
Posts: 63
Joined: Sat Sep 10, 2005 7:05 am

Postby jondaley on Mon Nov 28, 2005 1:16 pm

sure.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby jondaley on Tue Nov 29, 2005 11:42 am

\357\273\277<?php^M
$messages['encoding'] = 'utf-8';^M


You need to remove the beginning three characters.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby Sarit on Tue Nov 29, 2005 11:46 am

Wait, it's working!
Yay! Finalllllly!

Thanks so very very much Jon!
Sarit
 
Posts: 63
Joined: Sat Sep 10, 2005 7:05 am


Return to Localization

cron