MaMo Net



#1 27.06.2010, 14:45
DeathkLaat Abwesend
Mitglied
Dabei seit: 13.06.2010
Beiträge: 9


Betreff: [Fix] Charset Problem
Zitat:
Warning: htmlentities() [function.htmlentities]: charset `XXXXX' not supported, assuming iso-8859-1 in classes\class.gpc.php on line 169

Do you get similiar or same error?
As htmlentities is not supporting many languages, i decided to use htmlspecialchars. Let's fix it for now!

Find this in "classes/class.gpc.php":
$var = htmlentities($var, ENT_QUOTES, $lang->charset(), false);

Replace with this:
$var = htmlspecialchars($var, ENT_QUOTES, false);

Find:
$var = htmlentities($var, ENT_QUOTES, $lang->charset());

Replace:
$var = htmlspecialchars($var, ENT_QUOTES);

Find:
function html_entity_decode($string, $mode = ENT_COMPAT)

Replace:
function htmlspecialchars_decode($string, $mode = ENT_COMPAT)

Find:
foreach (get_html_translation_table(HTML_ENTITIES, $mode) as $val=>$key)

Replace:
foreach (get_html_translation_table(HTML_SPECIALCHARS, $mode) as $val=>$key)

Find:
$var = $this->html_entity_decode($var, ENT_QUOTES);

Replace:
$var = $this->htmlspecialchars_decode($var, ENT_QUOTES);

Find:
$var = html_entity_decode($var, ENT_QUOTES, $lang->charset());

Replace:
$var = htmlspecialchars_decode($var, ENT_QUOTES);

Done! Smiling
Hasan Özbey
Dieser Beitrag wurde 2 mal editiert, das letzte Mal am 27.06.2010, 21:03 von DeathkLaat. ↑  ↓

#2 27.06.2010, 20:31
MaMo Abwesend
Administrator
Dabei seit: 06.04.2004
Beiträge: 2.673


Betreff: Re: [Fix] Charset Problem
Hi,

can't fix it as htmlentities is needed for several reasons, htmlspecialchars is not enough. PHP should implement more charsets...
Well, it would be possible to fix this, but that would be a major rewrite of the whole codebase.

Regards
MaMo
Matthias M.
=> Support nur per Forum - dann haben alle etwas davon!
Dieser Beitrag wurde 1 mal editiert, das letzte Mal am 27.06.2010, 20:31 von MaMo. ↑  ↓

#3 27.06.2010, 20:37
MaMo Abwesend
Administrator
Dabei seit: 06.04.2004
Beiträge: 2.673


Betreff: Re: [Fix] Charset Problem
Hi,

this could lead to unexpected behaviour, be careful!

Regards
MaMo
Matthias M.
=> Support nur per Forum - dann haben alle etwas davon!
↑  ↓

#4 27.06.2010, 21:02
DeathkLaat Abwesend
Mitglied
Dabei seit: 13.06.2010
Beiträge: 9


Betreff: Re: [Fix] Charset Problem
Thanks for information MaMo,
But I have to do this for turkish language until "viscacha" fix this problem. This is just a temporary solution.
Hasan Özbey
↑  ↓

Seiten (1): 1


Alle Zeitangaben in GMT +01:00. Aktuelle Uhrzeit: 21:58.