Edit report at https://bugs.php.net/bug.php?id=40035&edit=1
ID: 40035 Updated by: yohg...@php.net Reported by: leonard-php-bugs at ottolander dot nl Summary: get_html_translation_table() ignores locale + [RFE] option to override charset -Status: Open +Status: Closed Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: irrelevant PHP Version: 5.2.0 -Assigned To: +Assigned To: yohgaki Block user comment: N Private report: N New Comment: You may specify encoding with current get_html_translation_table() http://php.net/manual/en/function.get-html-translation-table.php Previous Comments: ------------------------------------------------------------------------ [2007-01-05 19:09:20] leonard-php-bugs at ottolander dot nl Looking at the source of php-5.2.0 I get the impression get_html_translation_table() actually ignores any locale settings: PHP_FUNCTION(get_html_translation_table): enum entity_charset charset = determine_charset(NULL TSRMLS_CC); static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC): /* Guarantee default behaviour for backwards compatibility */ if (charset_hint == NULL) return cs_8859_1; If I am reading the above correctly determine_charset() will always return cs_8859_1 to get_html_translation_table() as the latter passes NULL as the charset_hint. So it's not only not possible to override the charset when returning the translation table (which might be useful when handling data that does not use the same charset as the system), it seems the function totally ignores the system locale. ------------------------------------------------------------------------ [2007-01-05 17:40:31] leonard-php-bugs at ottolander dot nl Description: ------------ get_html_translation_table() will only return the translation table for the default character set (iso-8859-1). Please add a third option (charset) to get_html_translation_table() to select the translation table for the character sets that are supported by html_entities(). (compare bug 18072) (Actually only tested against php-4.3.9 (CentOS 4) and php-4.3.2 (CentOS 3), but as there is no change in the docs I find it highly unlikely this option has been added in the mean time. If it has I apologize.) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=40035&edit=1