Index: sapi/cli/php_cli.c =================================================================== RCS file: /repository/php-src/sapi/cli/php_cli.c,v retrieving revision 1.179 diff -u -p -d -r1.179 php_cli.c --- sapi/cli/php_cli.c 6 May 2007 12:57:27 -0000 1.179 +++ sapi/cli/php_cli.c 4 Jun 2007 08:17:31 -0000 @@ -143,6 +143,7 @@ static const opt_struct OPTIONS[] = { {'i', 0, "info"}, {'l', 0, "syntax-check"}, {'m', 0, "modules"}, + {'N', 0, "no-unicode"}, {'n', 0, "no-php-ini"}, {'q', 0, "no-header"}, /* for compatibility with CGI (do not generate HTTP headers) */ {'R', 1, "process-code"}, @@ -150,6 +151,7 @@ static const opt_struct OPTIONS[] = { {'r', 1, "run"}, {'s', 0, "syntax-highlight"}, {'s', 0, "syntax-highlighting"}, + {'U', 0, "unicode"}, {'w', 0, "strip"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, @@ -454,6 +456,7 @@ static void php_cli_usage(char *argv0) " -i PHP information\n" " -l Syntax check only (lint)\n" " -m Show compiled in modules\n" + " -N Turn off Unicode mode\n" " -r Run PHP without using script tags \n" " -B Run PHP before processing input lines\n" " -R Run PHP for every input line\n" @@ -461,6 +464,7 @@ static void php_cli_usage(char *argv0) " -E Run PHP after processing all input lines\n" " -H Hide any passed arguments from external tools.\n" " -s Display colour syntax highlighted source.\n" + " -U Turn on Unicode mode\n" " -v Version number\n" " -w Display source with stripped comments and whitespace.\n" " -z Load Zend extension .\n" @@ -671,6 +675,24 @@ int main(int argc, char *argv[]) while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) { switch (c) { + case 'U': { + int len = sizeof("unicode.semantics") - 1; + + cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0")); + memcpy(cli_sapi_module.ini_entries + ini_entries_len, "unicode.semantics", len); + memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0")); + ini_entries_len += len + sizeof("=1\n\0") - 2; + } + break; + case 'N': { + int len = sizeof("unicode.semantics") - 1; + + cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("=0\n\0")); + memcpy(cli_sapi_module.ini_entries + ini_entries_len, "unicode.semantics", len); + memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "=0\n\0", sizeof("=0\n\0")); + ini_entries_len += len + sizeof("=0\n\0") - 2; + } + break; case 'c': if (cli_sapi_module.php_ini_path_override) { free(cli_sapi_module.php_ini_path_override);