Bug #61827 [Com]: incorrect \e processing
Edit report at https://bugs.php.net/bug.php?id=61827&edit=1
ID: 61827
Comment by: ab@php.net
Reported by: ab@php.net
Summary: incorrect \e processing
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: windows
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
Btw. compiling that snippet on windows there is an interesting line in the compiler out:
>cl esc.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
esc.c
esc.c(5) : warning C4129: 'e' : unrecognized character escape sequence
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:esc.exe
esc.obj
Previous Comments:
------------------------------------------------------------------------
[2012-04-23 15:35:13] ab@php.net
Description:
------------
Zend\tests\bug60350.phpt fails on windows. Simple reproduce case
> Debug_TS\php -r "$str = \"\e\"; var_dump(ord($str));"
int(101)
where it should be 27
The implementation in bug 60350 seems to be not compatible with windows, consider the following
snippet
==========================================
#include <stdio.h>
int main(void)
{
printf("'%d' '%c' '%d'\n", (int)'\e',
(char)27, (int)(char)27);
return 0;
}
==========================================
compiled on linux it gives
'27' ' '27'
compiled on windows
'101' 'â' '27'
The current implementation uses '\e' for escaping, which should be (char)27 on windows.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61827&edit=1
Thread (8 messages)