summaryrefslogtreecommitdiff
path: root/ext/gettext/gettext.c
diff options
context:
space:
mode:
authorJon Parise <jon@php.net>2001-11-09 16:27:09 +0000
committerJon Parise <jon@php.net>2001-11-09 16:27:09 +0000
commit8f26c3f326c66d0ba549df589de24f27288dcefc (patch)
treec7bd8089f2832db59f69adc93cb1da3b68979ad4 /ext/gettext/gettext.c
parent8ee38d9d75f02b604106887b2548d30b7c913414 (diff)
downloadphp-git-8f26c3f326c66d0ba549df589de24f27288dcefc.tar.gz
@ Added support for bind_textdomain_codeset(). (rudib@email.si)
Diffstat (limited to 'ext/gettext/gettext.c')
-rw-r--r--ext/gettext/gettext.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index f29dbdba30..f8f841f81a 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -49,6 +49,11 @@ function_entry php_gettext_functions[] = {
#if HAVE_DCNGETTEXT
PHP_FE(dcngettext, NULL)
#endif
+#if HAVE_BIND_TEXTDOMAIN_CODESET
+ PHP_FE(bind_textdomain_codeset, NULL)
+#endif
+
+
{NULL, NULL, NULL}
};
/* }}} */
@@ -269,6 +274,30 @@ PHP_FUNCTION(dcngettext)
/* }}} */
#endif
+#if HAVE_BIND_TEXTDOMAIN_CODESET
+
+/* {{{ proto string bind_textdomain_codeset (string domain, string codeset)
+ Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */
+PHP_FUNCTION(bind_textdomain_codeset)
+{
+ zval **domain, **codeset;
+ char *retval;
+
+ if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain, &codeset) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ } else {
+ convert_to_string_ex(domain);
+ convert_to_string_ex(codeset);
+
+ retval = bind_textdomain_codeset(Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset));
+
+ RETURN_STRING(retval, 1);
+ }
+}
+/* }}} */
+#endif
+
+
#endif /* HAVE_LIBINTL */
/*