> An alternative approach I'm considering is to store separate copies of my
> templates, one set for each language.
That is how I do it as well; There are a number of advantages to this approach though, one being is that you can more easily have variable formatted layouts on a locale basis, for example?
> How do you save php files as utf-8?
In your favourite editor (I use jEdit) you can select which encoding to use, so read up on your editors documentation. In regards to using UTF-8, you need to declare this encoding in your templates meta data.
Notepad from what I believe is basic ASCII only and doesn't support Unicode.
You are better off to use the encoding in all of your forms as well, and just to be sure, send the encoding in your headers as well, which for the majority of browsers, the send header will over-ride the encoding specified in the template... But that is what you want anyways, since the encoding specified in the template is a fail safe - a fall back if you want?
Then there is your database, it's better to specify UTF-8 as well, when you create you database schema, ie
Code:
// example for mysql
create table ... (
... ) engine=innodb, charset=utf8, auto_increment=1
Look at the Wikipedia as well
Bookmarks