derick          Mon Mar  8 17:18:06 2004 EDT

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/mbstring       mbstring.c mbstring.h 
    /php-src/ext/mbstring/libmbfl/mbfl  mbfl_encoding.c mbfl_encoding.h 
  Log:
  - Added mb_list_encoding() to return an array with all mbstring supported
    encodings.
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1624&r2=1.1625&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1624 php-src/NEWS:1.1625
--- php-src/NEWS:1.1624 Mon Mar  8 14:00:21 2004
+++ php-src/NEWS        Mon Mar  8 17:18:02 2004
@@ -3,6 +3,8 @@
 ?? March 2004, PHP 5 Release Candidate 1
 - Changed Iterator::has_more() to Iterator::valid(). (Marcus)
 - Upgraded bundled oniguruma library to version 2.2.2. (Rui, Moriyoshi)
+- Added mb_list_encoding() to return an array with all mbstring supported
+  encodings. (Derick)
 - Added support for more ISO8601 style datetime formats. (Moriyoshi)
   . Timezone specifier (ex. "20040301T02:00:00+19:00")
   . Week specifier (ex. "1997W021")
http://cvs.php.net/diff.php/php-src/ext/mbstring/mbstring.c?r1=1.210&r2=1.211&ty=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.210 php-src/ext/mbstring/mbstring.c:1.211
--- php-src/ext/mbstring/mbstring.c:1.210       Sat Mar  6 14:29:52 2004
+++ php-src/ext/mbstring/mbstring.c     Mon Mar  8 17:18:03 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.c,v 1.210 2004/03/06 19:29:52 iliaa Exp $ */
+/* $Id: mbstring.c,v 1.211 2004/03/08 22:18:03 derick Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring"
@@ -196,6 +196,7 @@
        PHP_FE(mb_strimwidth,                   NULL)
        PHP_FE(mb_convert_encoding,             NULL)
        PHP_FE(mb_detect_encoding,              NULL)
+       PHP_FE(mb_list_encodings,               NULL)
        PHP_FE(mb_convert_kana,                 NULL)
        PHP_FE(mb_encode_mimeheader,    NULL)
        PHP_FE(mb_decode_mimeheader,    NULL)
@@ -2235,6 +2236,24 @@
 }
 /* }}} */
 
+/* {{{ proto array mb_list_encodings()
+   Returns an array of all supported encodings */
+PHP_FUNCTION(mb_list_encodings)
+{
+       const mbfl_encoding **encodings;
+       const mbfl_encoding *encoding;
+       int i;
+
+       array_init(return_value);
+       i = 0;
+       encodings = mbfl_get_supported_encodings();
+       while ((encoding = encodings[i++]) != NULL) {
+               add_next_index_string(return_value, encoding->name, 1);
+       }
+}
+/* }}} */
+
+
 /* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string 
transfer-encoding [, string linefeed]]])
    Converts the string to MIME "encoded-word" in the format of 
=?charset?(B|Q)?encoded_string?= */
 PHP_FUNCTION(mb_encode_mimeheader)
http://cvs.php.net/diff.php/php-src/ext/mbstring/mbstring.h?r1=1.64&r2=1.65&ty=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.64 php-src/ext/mbstring/mbstring.h:1.65
--- php-src/ext/mbstring/mbstring.h:1.64        Sat Jan 17 07:59:30 2004
+++ php-src/ext/mbstring/mbstring.h     Mon Mar  8 17:18:03 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.h,v 1.64 2004/01/17 12:59:30 sniper Exp $ */
+/* $Id: mbstring.h,v 1.65 2004/03/08 22:18:03 derick Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
@@ -111,6 +111,7 @@
 PHP_FUNCTION(mb_strimwidth);
 PHP_FUNCTION(mb_convert_encoding);
 PHP_FUNCTION(mb_detect_encoding);
+PHP_FUNCTION(mb_list_encodings);
 PHP_FUNCTION(mb_convert_kana);
 PHP_FUNCTION(mb_encode_mimeheader);
 PHP_FUNCTION(mb_decode_mimeheader);
http://cvs.php.net/diff.php/php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c?r1=1.5&r2=1.6&ty=u
Index: php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c:1.5 
php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c:1.6
--- php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c:1.5       Thu Dec  4 17:49:46 
2003
+++ php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c   Mon Mar  8 17:18:05 2004
@@ -264,6 +264,12 @@
        }
 }
 
+const mbfl_encoding **
+mbfl_get_supported_encodings(void)
+{
+       return mbfl_encoding_ptr_list;
+}
+
 const char *
 mbfl_no2preferred_mime_name(enum mbfl_no_encoding no_encoding)
 {
http://cvs.php.net/diff.php/php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h?r1=1.2&r2=1.3&ty=u
Index: php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h:1.2 
php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h:1.3
--- php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h:1.2       Sun Aug 24 21:44:16 
2003
+++ php-src/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h   Mon Mar  8 17:18:05 2004
@@ -117,6 +117,7 @@
 MBFLAPI extern const mbfl_encoding * mbfl_name2encoding(const char *name);
 MBFLAPI extern const mbfl_encoding * mbfl_no2encoding(enum mbfl_no_encoding 
no_encoding);
 MBFLAPI extern enum mbfl_no_encoding mbfl_name2no_encoding(const char *name);
+MBFLAPI extern const mbfl_encoding ** mbfl_get_supported_encodings();
 MBFLAPI extern const char * mbfl_no_encoding2name(enum mbfl_no_encoding no_encoding);
 MBFLAPI extern const char * mbfl_no2preferred_mime_name(enum mbfl_no_encoding 
no_encoding);
 MBFLAPI extern int mbfl_is_support_encoding(const char *name);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to