Umlaute in Sofortantwort falsch

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Umlaute in Sofortantwort falsch

Post by Anotherone »

Bin nicht sicher, ob das ein Fall für den Bugtracker ist, daher frage ich vorher mal:

Ich habe überall ordentliche Umlaute, nur in der Sofortantwort werden sie verunstaltet. Könnte es daran liegen, das die Kodierung iso-8859-1 ist? Die DB (MySQL5) speichert in Unicode. Wo könnte man ansetzen, um das zu ändern, kenne das System erst ein paar Tage und finde daher nicht alles sofort.

Danke schon mal

Anotherone
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

tippst du sie auch als Unicode ein?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

Ich denke ja, da hier eigentlich alles Unicode ist (Ubuntu 7.04).
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

du nutzt deutsch und die deutsche Sprachdatei nutzt nur iso-8859-1. Deswegen wird dein Unicode noch mal kodiert, was falsch ist.

Eine Lösung wäre, die lang/language_de.php als UTF-8 abzuspeichern und das dann auch da drin einzutragen, ist dort der erste Eintrag.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

Leider behebt die Umstellung auf utf-8 das Problem nicht:

Image
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

Noch was (ich hab da mal recherchiert): In der ajaxresponse wird ja geprüft ob utf-8 oder nicht und da hilft bei mir folgendes:

Code: Select all

if (isset($_POST['search'])) {
    $searchString = $db->escape_string(trim(strip_tags($_POST['search'])));
    $result = searchEngine($searchString, '%', false, true, true);
    if (strtolower($PMF_LANG['metaCharset']) != 'utf-8') {
        print utf8_encode($result);
    } else {
        print utf8_decode($result);
    }
}
sprich es wird utf-8 decodiert, obwohl das eigentlich gar nicht sein sollte, aber es geht.
Last edited by Anotherone on Sat Aug 25, 2007 6:08 pm, edited 1 time in total.
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

hast du die language_de.php auch in UTF-8 abgespeichert, inklusive der Umlaute?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

Ja logisch, musste erstmal den FAQ-Beitrag überarbeiten, aber habe gerade meinen Beitrag angepasst, jetzt geht es nämlich, auch wenn ich es nicht hundertprozentig verstehe. Wird das vielleicht durch den Ajaxtransfer nötig?
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

nein, ich meinte, steht da in der language_de.php auch utf-8 drin? Du musst

Code: Select all

$PMF_LANG["metaCharset"] = "iso-8859-1";
auf

Code: Select all

$PMF_LANG["metaCharset"] = "utf-8";
ändern.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

Das hab ich gemacht,

Code: Select all

<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
aber außer das sich die Art der Darstellung der Umlaute geändert hat, war das Problem immer noch da. Ich hatte bei der Abfrage ob utf-8 oder nicht einen Denkfehler, aber das utf8_decode bringts bei mir. Aber logisch find ichs nicht.
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

wie sehen die Umlaute in der DB aus?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

So wie sie in der Sofortantwort angezeigt werden. phpmyadmin und MySQL stehen auf UTF-8.
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

also auch kaputt?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Anotherone
Posts: 14
Joined: Thu Aug 23, 2007 8:43 pm

Post by Anotherone »

Ja, mit den unlesbaren Umlauten
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

dann gibst du die schon irgendwie falsch ein, dann liegt das problem irgendwo anders... Welches MySQL nutzt du denn?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply