|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
king1995 Smarty n00b
Joined: 30 Jul 2013 Posts: 1
|
Posted: Tue Jul 30, 2013 8:28 am Post subject: Probleme mit UTF-8 |
|
|
Hallo,
ich habe ein Webprojekt und wollte dies aufgrund nervender Umlaut-Problemen auf UTF-8 laufen lassen.
Ich habe folgendes dafür getan:
1) .htaccess : AddCharset utf-8 .css .htm .html .xhtml .php
2) In die Index.php (verwaltet den Klassenzugriff): header("content-type: text/html; charset=utf-8");
3) define('SMARTY_RESOURCE_CHAR_SET', 'UTF-8');
4) in den Head-Tag des Layouts (layout.tpl): <meta http-equiv="content-type" content="text/html; charset=utf-8" charset="utf-8">
5) In die CSS Datein: @charset "utf-8";
6) Versucht alle Datein als Charset UTF-8 zu speichern.
Ich benutze Smarty-3.1.14
Wenn ich nun ein Umlaut ins layout.tpl schreibe wird dieser korrekt angezeigt. In der layout.tpl wird die entsprechende angeforderte Seite per {include file=""} eingefügt. Wenn ich in dieser eingefügten datei Umlaute schreibe werden diese als Fragezeichen angezeigt.
Was ich ziemlich komisch finde ist, dass wenn ich an den Anfang der eingefügten Datei <meta http-equiv="content-type" content="text/html; charset=utf-8" charset="utf-8"> schreibe, dass dann die Umlaute auch in der eingefügten Datei korrekt angezeigt werden.
Ich hoffe ihr könnt mir helfen ?! |
|
Back to top |
|
Fahrstuhllicht Smarty Rookie
Joined: 10 Jun 2013 Posts: 15 Location: Berlin
|
Posted: Wed Jul 31, 2013 7:24 am Post subject: |
|
|
Ich hatte das Problem auch bis ich heraus gefunden habe, dass ich bei mir im Notepad++ die Sprache auf UTF-8 ohne BOM einstellen kann. Ich habe bis heute keine Ahnung, was dieser Befehl mit der Datei macht, aber seit dem her funktionierts. |
|
Back to top |
|
|
|
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
|