Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{include file= and Encoding problems ( UTF-8 ) - SOLVED!!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
herrkaleun
Smarty n00b


Joined: 03 Jun 2008
Posts: 3

PostPosted: Tue Jun 03, 2008 4:43 pm    Post subject: {include file= and Encoding problems ( UTF-8 ) - SOLVED!! Reply with quote

Hello Friends,

first of all, our suspect is a webpage with smarty, divided into
3 parts, header, index and footer.

as database, i use a MySQL db encoded with UTF 8.

Now: the PROBLEM:

Ive multilingual data stored in my database and index,
especially turkish words with special chars like "ğüşiöçĞÜŞİÖÇı".

Now, in my header, i declared the site as UTF-8, and when processing
the pages, i try to include them with "include file" so i have a seperated
header.

When the page compiles, i have a result, that shows the page partially
wrong.

Sometimes (when i play with the charset and set it to windows-1254)
i get the data in the index right, but the data from the database wrong,
and when i change things, set the database to NAMES Latin5 i get the
data from the database displayed correct, and the data in the index page wrong.

the architecture is like:

header.tpl
index.tpl
footer.tpl

i really suspect the file encodings on their own, just before they somehow
are compiled and/or displayed. When i open the TPL files, some have
ANSI as encoding, and some have UTF-8.

i tryed to play with them, but after some couple of days, i still have this
persisting problem, and im sick after all and now need some help Smile

What i want from the helper:

What is the correct order of steps for:

a) creating a multilingual database
b) setting up a header, index and footer (with encoding)
c) tell me if i need to do something extra

i also tryed various combinations of :

mysql_query("SET NAMES UTF8");
mysql_query("SET NAMES 'latin5'");
mysql_query("SET CHARACTER SET latin5");
mysql_query("SET COLLATION_CONNECTION = 'latin5_turkish_ci'");


but none of them seemed to solve my issue correctly.

I must say that i have a complex envoirment where i develop this
website. I have a client running on VirtualBox (XP) where it gets the
files from a Network Drive hosted on a Linux Box so that might be
the reason why the files get sooo screwed. But i also tryed to edit all
files on the XP Box but it didnt help either Sad

It is actually a long post, but i would be VERY VERY thankfull if someone
could help me out of this.

I would even send the entire website to you if you would like to inspect
it, its written in pure OOP.

THANKS IN ADVANCE, i hope you can help me Smile

ps: if you did reat it up to here, thanks man, even that shows
what a good person you are.


Last edited by herrkaleun on Tue Jun 03, 2008 9:06 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Jun 03, 2008 6:19 pm    Post subject: Reply with quote

Make shure that the editor which you are using to edit the templates is storing the files also in UTF-8 format.
Back to top
View user's profile Send private message
herrkaleun
Smarty n00b


Joined: 03 Jun 2008
Posts: 3

PostPosted: Tue Jun 03, 2008 6:53 pm    Post subject: Reply with quote

hmm danke Smile

ich werde das sofort überprüfen
Back to top
View user's profile Send private message Send e-mail
herrkaleun
Smarty n00b


Joined: 03 Jun 2008
Posts: 3

PostPosted: Tue Jun 03, 2008 9:03 pm    Post subject: Reply with quote

Hello Friends:)

SOLVED!

That was it, i explicitly edited all files and saved them as UTF-8,
edited the DB, deleted and restored it again in UTF-8

now everything works as it should Smile

THANKS A LOT Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP