The buildSelect function has a minor bug
Posted: Tue Nov 15, 2005 11:48 pm
Hello again,
The buildSelect function has a minor bug that prohibits translations to be displayed correctly:
line in zm_funcs.php formats the input from all db and translation entries to have proper HTML entities.
However, used with no parms forces the input to be in iso-8859-1 encoding only.
Instead I used:
which allows the code to convert both single and double quotes in $content_text to proper HTM entities and also be aware of the translation charset.
The variable $charset is in the zm_lang_tr_tr.php, which is the translation file for Turkish. I have also included these in the file's beginning:
htmlentities() supports a couple of charsets so please check http://www.php.net/htmlentities for details.
Regards,
Koray
The buildSelect function has a minor bug that prohibits translations to be displayed correctly:
Code: Select all
<option value="<?= $content_value ?>"<?php if ( $value == $content_value ) { echo " selected"; } ?>><?= htmlentities($content_text) ?></option>
However, used with no parms forces the input to be in iso-8859-1 encoding only.
Instead I used:
Code: Select all
<option value="<?= $content_value ?>"<?php if ( $value == $content_value ) { echo " selected"; } ?>><?= htmlentities($content_text,ENT_QUOTES,$charset) ?></option>
The variable $charset is in the zm_lang_tr_tr.php, which is the translation file for Turkish. I have also included these in the file's beginning:
Code: Select all
$charset="utf-8";
header( "Content-Type: text/html; $charset" );
setlocale( LC_ALL, "tr_TR.$charset" ); //All locale settings 4.3.0 and after
setlocale( LC_CTYPE, "tr_TR.$charset" ); //Character class settings 4.3.0 and after
setlocale( LC_TIME, "tr_TR.$charset" ); //Date and time formatting 4.3.0 and after
Regards,
Koray