View previous topic :: View next topic |
Author |
Message |
chorlya Smarty n00b
Joined: 23 Jul 2004 Posts: 1
|
Posted: Fri Jul 23, 2004 5:29 pm Post subject: Smarty and UTF8 encoded files |
|
|
Hi all,
I have a strange problem with smarty and UTF8 encoded files on Win2000 maschine. I'm runing PHP 4.3.0 and Smarty 2.6.3.
Here's the problem:
my template is in UTF8 encoded file and when smarty parses it, it adds some characters(see below) on the begining of first line and that is breaking my design. Is Smarty even suposed to work with UTF8 files? And is there a solution to this problem?
If I convert the file to ascii then it works OK, but that's not it really
Thanks
first 16 bytes of my template file:
FF FE 3C 00 21 00 44 00 4F 00 43 00 54 00 59 00 ; ˙ţ<.!.D.O.C.T.Y.
same line in compiled template file:
FF FE FF FE 3C 00 21 00 44 00 4F 00 43 00 54 00 ; ˙ţ˙ţ<.!.D.O.C.T.
first 16 bytes of what browser recives:
FF FE 09 00 FF FE 3C 00 21 00 44 00 4F 00 43 00 ; ˙ţ..˙ţ<.!.D.O.C. |
|
Back to top |
|
nguyenvinhquang Smarty n00b
Joined: 25 Oct 2004 Posts: 1
|
Posted: Mon Oct 25, 2004 11:03 am Post subject: |
|
|
I'v got the same problem . I'm a Vietnamese and my web pages must be saved in UTF-8 format. Anybody tell me how to solve this problem! Thanks! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Oct 25, 2004 11:23 am Post subject: |
|
|
you have to remove the BOM (Byte Order Mark, the 0xfffe) from the beginning of all files. |
|
Back to top |
|
Janis Smarty Rookie
Joined: 11 Jan 2007 Posts: 10
|
Posted: Thu Jul 05, 2007 7:42 pm Post subject: |
|
|
Anybody who had this problem succeeded in solving them?
I have exactly the same problem! (I really didn't thought there would be topic about this or if there were - I wouldn't be able to find it. )
And I checked all the templates that are being used, and none of them have anything odd at the front. Not now anyway. I checked it with several editors to be sure of it, including Linux vim editor which clearly showed two FEFF characters in front of the resulting web page source.
Where else could this extra character/s? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Jul 06, 2007 6:26 am Post subject: |
|
|
Look harder and make sure you tell your editor to save files without the BOM. Based on the first post, I think Messju is 100% right (as usual!).
Best of luck. |
|
Back to top |
|
Janis Smarty Rookie
Joined: 11 Jan 2007 Posts: 10
|
Posted: Sun Jul 08, 2007 7:41 pm Post subject: |
|
|
OK, I found a BOM in some language file in the other script I used (which used Smarty). That's one BOM less.
I cannot find the other one but I probably won't look more as only two BOMs result in an extra space in IE6, one apparently doesn't matter.
Thanks! |
|
Back to top |
|
Numinvest Smarty n00b
Joined: 03 Feb 2010 Posts: 1
|
Posted: Thu Feb 04, 2010 9:57 am Post subject: |
|
|
Hi all,
I also have somthing with the char FEFF, I don't know why...
The problem is a one-line space on the top (If I save the viewved page and open it with vim, I see <feff> just after <body>)
I work with ssh and editing with vim, but I m a beginner in file encoding
I just noticed than if I comment the "session_start()" thing, the space disappear, but my scripts files are supposely to be in utf-8 ..
Can someone help me ? |
|
Back to top |
|
|