From: Andrei Zmievski Date: Tue, 12 Dec 2006 18:24:16 +0000 (+0000) Subject: Do not convert args to Unicode in getopt(), they should stay binary. X-Git-Tag: RELEASE_1_0_0RC1~706 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=066ab3c3cf41039cce62be95f7421601768ab48f;p=php Do not convert args to Unicode in getopt(), they should stay binary. --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index fe9451a687..b9203f035a 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4497,7 +4497,7 @@ static void free_longopts(struct option *longopts) /* }}} */ #endif -/* {{{ proto array getopt(string options [, array longopts]) +/* {{{ proto array getopt(string options [, array longopts]) U Get options from the command line argument list */ PHP_FUNCTION(getopt) { @@ -4634,7 +4634,8 @@ PHP_FUNCTION(getopt) MAKE_STD_ZVAL(val); if (optarg != NULL) { - ZVAL_RT_STRING(val, optarg, 1); + /* keep the arg as binary, since the encoding is not known */ + ZVAL_STRING(val, optarg, 1); } else { ZVAL_FALSE(val); }