moriyoshi Tue Dec 2 02:36:43 2003 EDT Modified files: /php-src/ext/standard quot_print.c quot_print.h /php-src/ext/iconv iconv.c Log: all '_' (underscores) should be replaced by '\x20' (whitespaces) in encoding. # should I bump API version? Index: php-src/ext/standard/quot_print.c diff -u php-src/ext/standard/quot_print.c:1.26 php-src/ext/standard/quot_print.c:1.27 --- php-src/ext/standard/quot_print.c:1.26 Tue Jun 10 16:03:38 2003 +++ php-src/ext/standard/quot_print.c Tue Dec 2 02:36:42 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: quot_print.c,v 1.26 2003/06/10 20:03:38 imajes Exp $ */ +/* $Id: quot_print.c,v 1.27 2003/12/02 07:36:42 moriyoshi Exp $ */ #include <stdlib.h> @@ -50,7 +50,7 @@ } } -PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length) +PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length, int replace_us_by_ws) { register unsigned int i; register unsigned const char *p1; @@ -79,6 +79,10 @@ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 }; + if (replace_us_by_ws) { + replace_us_by_ws = '_'; + } + i = length, p1 = str; buf_size = length; while (i > 1 && *p1 != '\0') { @@ -127,7 +131,7 @@ return NULL; } } else { - *(p2++) = *p1; + *(p2++) = (replace_us_by_ws == *p1 ? '\x20': *p1); i--, p1++, decoded_len++; } } Index: php-src/ext/standard/quot_print.h diff -u php-src/ext/standard/quot_print.h:1.10 php-src/ext/standard/quot_print.h:1.11 --- php-src/ext/standard/quot_print.h:1.10 Tue Jun 10 16:03:38 2003 +++ php-src/ext/standard/quot_print.h Tue Dec 2 02:36:42 2003 @@ -16,12 +16,12 @@ +----------------------------------------------------------------------+ */ -/* $Id: quot_print.h,v 1.10 2003/06/10 20:03:38 imajes Exp $ */ +/* $Id: quot_print.h,v 1.11 2003/12/02 07:36:42 moriyoshi Exp $ */ #ifndef QUOT_PRINT_H #define QUOT_PRINT_H -PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length); +PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t length, size_t *ret_length, int replace_us_by_ws); PHP_FUNCTION(quoted_printable_decode); Index: php-src/ext/iconv/iconv.c diff -u php-src/ext/iconv/iconv.c:1.102 php-src/ext/iconv/iconv.c:1.103 --- php-src/ext/iconv/iconv.c:1.102 Mon Dec 1 18:49:20 2003 +++ php-src/ext/iconv/iconv.c Tue Dec 2 02:36:42 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iconv.c,v 1.102 2003/12/01 23:49:20 moriyoshi Exp $ */ +/* $Id: iconv.c,v 1.103 2003/12/02 07:36:42 moriyoshi Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1478,7 +1478,7 @@ break; case PHP_ICONV_ENC_SCHEME_QPRINT: - decoded_text = (char *)php_quot_print_decode((unsigned char*)encoded_text, (int)encoded_text_len, &decoded_text_len); + decoded_text = (char *)php_quot_print_decode((unsigned char*)encoded_text, (int)encoded_text_len, &decoded_text_len, 1); break; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php