]> granicus.if.org Git - php/commitdiff
Hash functions for UTF-8 keys.
authorAndrei Zmievski <andrei@php.net>
Sat, 7 Oct 2006 17:34:19 +0000 (17:34 +0000)
committerAndrei Zmievski <andrei@php.net>
Sat, 7 Oct 2006 17:34:19 +0000 (17:34 +0000)
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_hash.c
Zend/zend_hash.h

index e416e2110d468e074e1eda6a28c1b8e936cdc1bd..9491c6f3e86b018727a367bea6f0844b8af902a7 100644 (file)
@@ -1333,6 +1333,11 @@ ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *valu
        return zend_rt_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL);
 }
 
+ZEND_API int add_utf8_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
+{
+       return zend_utf8_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void*)&value, sizeof(zval*), NULL);
+}
+
 ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value)
 {
        return zend_u_symtable_update(Z_ARRVAL_P(arg), type, key, key_len, (void *) &value, sizeof(zval *), NULL);
index 64e2b5cc5a1641298ab38d64b0cb0a4ffcfafc71..d3121a1e067986a8d6b6a44d7aff536f6de0fffe 100644 (file)
@@ -754,6 +754,150 @@ ZEND_API int add_rt_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *valu
 #define add_rt_assoc_text(__arg, __key, __str, __duplicate) add_rt_assoc_test_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
 #define add_rt_assoc_textl(__arg, __key, __str, __length, __duplicate) add_rt_assoc_textl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
 
+ZEND_API int add_utf8_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
+
+#define add_utf8_assoc_null_ex(arg, key, key_len) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_NULL(___tmp); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_long_ex(arg, key, key_len, n) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_LONG(___tmp, n); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_bool_ex(arg, key, key_len, b) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_BOOL(___tmp, b); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_resource_ex(arg, key, key_len, r) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_RESOURCE(___tmp, r); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_double_ex(arg, key, key_len, d) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_DOUBLE(___tmp, d); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_STRINGL(___tmp, str, length, duplicate); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_UNICODE(___tmp, str, duplicate); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_UNICODEL(___tmp, str, length, duplicate); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_ZSTR(___tmp, str, type, duplicate); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \
+               zval *___tmp; \
+               MAKE_STD_ZVAL(___tmp); \
+               ZVAL_ZSTRL(___tmp, str, length, type, duplicate); \
+               add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
+       } while (0)
+#define add_utf8_assoc_text_ex(arg, key, key_len, str, duplicate) do { \
+               if (UG(unicode)) { \
+                       add_utf8_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
+               } else { \
+                       add_utf8_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \
+               } \
+       } while (0)
+#define add_utf8_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \
+               if (UG(unicode)) { \
+                       add_utf8_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
+               } else { \
+                       add_utf8_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \
+               } \
+       } while (0)
+
+#define add_utf8_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
+               if (UG(unicode)) { \
+                       UChar *___u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \
+                       if ((flags) & ZSTR_AUTOFREE) { \
+                               efree(str); \
+                       } \
+                       add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, length, 0); \
+               } else { \
+                       add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+               } \
+       } while (0)
+#define add_utf8_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
+               if (UG(unicode)) { \
+                       UErrorCode ___status = U_ZERO_ERROR; \
+                       UChar *___u_str; \
+                       int ___u_len; \
+                       zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length, &___status); \
+                       if ((flags) & ZSTR_AUTOFREE) { \
+                               efree(str); \
+                       } \
+                       add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+               } else { \
+                       add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+               } \
+       } while (0)
+#define add_utf8_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
+               if (UG(unicode)) { \
+                       UErrorCode ___status = U_ZERO_ERROR; \
+                       UChar *___u_str; \
+                       int ___u_len; \
+                       zend_string_to_unicode_ex(UG(utf8_conv), &___u_str, &___u_len, str, length, &___status); \
+                       if ((flags) & ZSTR_AUTOFREE) { \
+                               efree(str); \
+                       } \
+                       add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+               } else { \
+                       add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+               } \
+       } while (0)
+
+#define add_utf8_assoc_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags)
+#define add_utf8_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags)
+#define add_utf8_assoc_rt_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags)
+#define add_utf8_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags)
+
+#define add_utf8_assoc_zval(__arg, __key, __value) add_utf8_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
+#define add_utf8_assoc_long(__arg, __key, __n) add_utf8_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
+#define add_utf8_assoc_null(__arg, __key) add_utf8_assoc_null_ex(__arg, __key, strlen(__key)+1)
+#define add_utf8_assoc_bool(__arg, __key, __b) add_utf8_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
+#define add_utf8_assoc_resource(__arg, __key, __r) add_utf8_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
+#define add_utf8_assoc_double(__arg, __key, __d) add_utf8_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
+#define add_utf8_assoc_string(__arg, __key, __str, __duplicate) add_utf8_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
+#define add_utf8_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_utf8_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
+#define add_utf8_assoc_unicode(__arg, __key, __str, __duplicate) add_utf8_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
+#define add_utf8_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_utf8_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
+#define add_utf8_assoc_zstr(arg, key, type, str, duplicate) add_utf8_assoc_zstr_ex(arg, key, strlen(key)+1, type, str, duplicate)
+#define add_utf8_assoc_zstrl(arg, key, type, str, length, duplicate) add_utf8_assoc_zstrl_ex(arg, key, strlen(key)+1, type, str, length, duplicate)
+#define add_utf8_assoc_ascii_string(arg, key, str, flags) add_utf8_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags)
+#define add_utf8_assoc_ascii_stringl(arg, key, str, length, flags) add_utf8_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
+#define add_utf8_assoc_rt_string(arg, key, str, flags) add_utf8_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
+#define add_utf8_assoc_rt_stringl(arg, key, str, length, flags) add_utf8_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
+#define add_utf8_assoc_utf8_string(arg, key, str, flags) add_utf8_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
+#define add_utf8_assoc_utf8_stringl(arg, key, str, length, flags) add_utf8_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
+#define add_utf8_assoc_text(__arg, __key, __str, __duplicate) add_utf8_assoc_test_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
+#define add_utf8_assoc_textl(__arg, __key, __str, __length, __duplicate) add_utf8_assoc_textl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
+
+
 ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value);
 
 #define add_u_assoc_null_ex(arg, type, key, key_len) do { \
index 44f3f37dff313cd680383ba8d010bc14ae63958c..e471b1aa70fef623b5cf4cf2bd779f8b1e97b94a 100644 (file)
@@ -357,6 +357,31 @@ string_key:
        }
 }
 
+ZEND_API int _zend_utf8_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
+{
+       TSRMLS_FETCH();
+
+       if (UG(unicode)) {
+               zstr key;
+               int ret;
+               UErrorCode status = U_ZERO_ERROR;
+               int u_len;
+
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+               if (U_FAILURE(status)) {
+                       ZEND_HASH_CVT_ERROR();
+                       goto string_key;
+               }
+
+               ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, u_len+1, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
+               efree(key.u);
+               return ret;
+       } else {
+string_key:
+               return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
+       }
+}
+
 ZEND_API int _zend_u_hash_quick_add_or_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
 {
        uint nIndex;
@@ -680,6 +705,30 @@ string_key:
        }
 }
 
+ZEND_API int zend_utf8_hash_del(HashTable *ht, char *arKey, uint nKeyLength)
+{
+       TSRMLS_FETCH();
+
+       if (UG(unicode)) {
+               zstr key;
+               int ret;
+               UErrorCode status = U_ZERO_ERROR;
+               int u_len;
+
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+               if (U_FAILURE(status)) {
+                       ZEND_HASH_CVT_ERROR();
+                       goto string_key;
+               }
+               ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, u_len+1, 0, HASH_DEL_KEY);
+               efree(key.u);
+               return ret;
+       } else {
+string_key:
+               return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, 0, HASH_DEL_KEY);
+       }
+}
+
 ZEND_API void zend_hash_destroy(HashTable *ht)
 {
        Bucket *p, *q;
@@ -1099,6 +1148,29 @@ string_key:
        }
 }
 
+ZEND_API int zend_utf8_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData)
+{
+       TSRMLS_FETCH();
+
+       if (UG(unicode)) {
+               zstr key;
+               int ret;
+               UErrorCode status = U_ZERO_ERROR;
+               int u_len;
+
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+               if (U_FAILURE(status)) {
+                       ZEND_HASH_CVT_ERROR();
+                       goto string_key;
+               }
+               ret = zend_u_hash_find(ht, IS_UNICODE, key, u_len+1, pData);
+               efree(key.u);
+               return ret;
+       } else {
+string_key:
+               return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData);
+       }
+}
 
 ZEND_API int zend_u_hash_quick_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void **pData)
 {
@@ -1219,6 +1291,30 @@ string_key:
     }
 }
 
+ZEND_API int zend_utf8_hash_exists(HashTable *ht, char *arKey, uint nKeyLength)
+{
+       TSRMLS_FETCH();
+
+       if (UG(unicode)) {
+               zstr key;
+               int ret;
+               UErrorCode status = U_ZERO_ERROR;
+               int u_len;
+
+               zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+               if (U_FAILURE(status)) {
+                       ZEND_HASH_CVT_ERROR();
+                       goto string_key;
+               }
+               ret = zend_u_hash_exists(ht, IS_UNICODE, key, u_len+1);
+               efree(key.u);
+               return ret;
+       } else {
+string_key:
+               return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength);
+    }
+}
+
 ZEND_API int zend_u_hash_quick_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h)
 {
        uint nIndex;
@@ -1948,6 +2044,33 @@ ZEND_API int zend_rt_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength
        return zend_rt_hash_exists(ht, arKey, nKeyLength);
 }
 
+ZEND_API int zend_utf8_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest)
+{
+       HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest));
+       return zend_utf8_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest);
+}
+
+
+ZEND_API int zend_utf8_symtable_del(HashTable *ht, char *arKey, uint nKeyLength)
+{
+       HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx))
+       return zend_utf8_hash_del(ht, arKey, nKeyLength);
+}
+
+
+ZEND_API int zend_utf8_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData)
+{
+       HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData));
+       return zend_utf8_hash_find(ht, arKey, nKeyLength, pData);
+}
+
+
+ZEND_API int zend_utf8_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength)
+{
+       HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx));
+       return zend_utf8_hash_exists(ht, arKey, nKeyLength);
+}
+
 ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
 {
        Bucket **p;
index b0abd2c3057139e2d8dbf43a39b10d3fb496660f..2245ff5574097fc4699b6c0deaf11ba84903eb86 100644 (file)
@@ -120,6 +120,7 @@ ZEND_API void zend_hash_clean(HashTable *ht);
 ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
 ZEND_API int _zend_ascii_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
 ZEND_API int _zend_rt_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
+ZEND_API int _zend_utf8_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
 ZEND_API int _zend_u_hash_add_or_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
 #define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
                _zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
@@ -127,6 +128,8 @@ ZEND_API int _zend_u_hash_add_or_update(HashTable *ht, zend_uchar type, zstr arK
                _zend_ascii_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
 #define zend_rt_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
                _zend_rt_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
+#define zend_utf8_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
+               _zend_utf8_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
 #define zend_u_hash_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
                _zend_u_hash_add_or_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
 #define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
@@ -135,6 +138,8 @@ ZEND_API int _zend_u_hash_add_or_update(HashTable *ht, zend_uchar type, zstr arK
                _zend_ascii_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
 #define zend_rt_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
                _zend_rt_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
+#define zend_utf8_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
+               _zend_utf8_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
 #define zend_u_hash_add(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
                _zend_u_hash_add_or_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
 
@@ -188,6 +193,7 @@ ZEND_API void zend_hash_to_unicode(HashTable *ht, apply_func_t apply_func TSRMLS
 ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag);
 ZEND_API int zend_ascii_hash_del(HashTable *ht, char *arKey, uint nKeyLength);
 ZEND_API int zend_rt_hash_del(HashTable *ht, char *arKey, uint nKeyLength);
+ZEND_API int zend_utf8_hash_del(HashTable *ht, char *arKey, uint nKeyLength);
 ZEND_API int zend_u_hash_del_key_or_index(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, int flag);
 #define zend_hash_del(ht, arKey, nKeyLength) \
                zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY)
@@ -203,6 +209,7 @@ ZEND_API ulong zend_u_get_hash_value(zend_uchar type, zstr arKey, uint nKeyLengt
 ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
 ZEND_API int zend_ascii_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
 ZEND_API int zend_rt_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
+ZEND_API int zend_utf8_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
 ZEND_API int zend_u_hash_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void **pData);
 ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData);
 ZEND_API int zend_u_hash_quick_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h, void **pData);
@@ -212,6 +219,7 @@ ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData);
 ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
 ZEND_API int zend_ascii_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
 ZEND_API int zend_rt_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
+ZEND_API int zend_utf8_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
 ZEND_API int zend_u_hash_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength);
 ZEND_API int zend_hash_quick_exists(HashTable *ht, char *arKey, uint nKeyLength, ulong h);
 ZEND_API int zend_u_hash_quick_exists(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, ulong h);
@@ -364,6 +372,11 @@ ZEND_API int zend_rt_symtable_del(HashTable *ht, char *arKey, uint nKeyLength);
 ZEND_API int zend_rt_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
 ZEND_API int zend_rt_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength);
 
+ZEND_API int zend_utf8_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest);
+ZEND_API int zend_utf8_symtable_del(HashTable *ht, char *arKey, uint nKeyLength);
+ZEND_API int zend_utf8_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
+ZEND_API int zend_utf8_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength);
+
 ZEND_API int zend_u_symtable_update(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest);
 ZEND_API int zend_u_symtable_del(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength);
 ZEND_API int zend_u_symtable_find(HashTable *ht, zend_uchar type, zstr arKey, uint nKeyLength, void **pData);