ID:               40035
 User updated by:  leonard-php-bugs at ottolander dot nl
-Summary:          [RFE] get_html_translation_table() add option to
                   select character set
 Reported By:      leonard-php-bugs at ottolander dot nl
 Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: irrelevant
-PHP Version:      4.4.4
+PHP Version:      5.2.0
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[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 http://bugs.php.net/?id=40035&edit=1

Reply via email to