summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_unicode.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-07-20 19:35:48 +0200
committerNikita Popov <nikita.ppv@gmail.com>2017-07-20 21:41:52 +0200
commitb3c1d9d1118438a3dae3544447db2b39ca5cfa25 (patch)
treeb7b213300905881fb7a11cca0e79d3c1f89ffc65 /ext/mbstring/php_unicode.c
parent2e75f84414d98756e527d9bf5829f47f9c520198 (diff)
downloadphp-git-b3c1d9d1118438a3dae3544447db2b39ca5cfa25.tar.gz
Directly use encodings instead of no_encoding in libmbfl
In particular strings now store encoding rather than the no_encoding. I've also pruned out libmbfl APIs that existed in two forms, one using no_encoding and the other using encoding. We were not actually using any of the former.
Diffstat (limited to 'ext/mbstring/php_unicode.c')
-rw-r--r--ext/mbstring/php_unicode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index f6f0e3f0e0..208c10319e 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -43,7 +43,7 @@
#include "mbstring.h"
#include "php_unicode.h"
#include "unicode_data.h"
-#include "libmbfl/filters/mbfilter_ucs4.h"
+#include "libmbfl/mbfl/mbfilter_wchar.h"
ZEND_EXTERN_MODULE_GLOBALS(mbstring)
@@ -310,8 +310,8 @@ MBSTRING_API char *php_unicode_convert_case(
mbfl_memory_device_init(&device, srclen + 1, 0);
/* encoding -> wchar filter */
- to_wchar = mbfl_convert_filter_new(src_encoding->no_encoding,
- mbfl_no_encoding_wchar, convert_case_filter, NULL, &data);
+ to_wchar = mbfl_convert_filter_new(src_encoding,
+ &mbfl_encoding_wchar, convert_case_filter, NULL, &data);
if (to_wchar == NULL) {
mbfl_memory_device_clear(&device);
return NULL;
@@ -319,7 +319,7 @@ MBSTRING_API char *php_unicode_convert_case(
/* wchar -> encoding filter */
from_wchar = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar, src_encoding->no_encoding,
+ &mbfl_encoding_wchar, src_encoding,
mbfl_memory_device_output, NULL, &device);
if (from_wchar == NULL) {
mbfl_convert_filter_delete(to_wchar);
@@ -355,7 +355,7 @@ MBSTRING_API char *php_unicode_convert_case(
}
*ret_len = result.len;
- return result.val;
+ return (char *) result.val;
}