Re: mb_ereg_replace problem with non a-z characters
McAjvar <[email protected]>
| Newsgroups | gmane.comp.php.internationalization |
|---|---|
| Message-ID | <[email protected]> |
hi!
thank you for your reply and showing there's life on this list :)
Moriyoshi Koizumi wrote:
> There are three possibilities:
> a. Function overloading doesn't work at all on those platforms
> for an unknown reason.
>
> Reportedly the plain ereg_replace() malfunctions with UTF-8.
>
> b. You are running FreeBSD on a 64 bit architecture and
> mb_ereg_replace() doesn't behave well with it.
>
> Recently some 64bit related bugs were addressed in mbstring,
> and there are probably ones missed still.
>
> c. BSD's libc implementation is borked and inproperly handles
> the argument of isalnum().
>
>
> To confirm those, please try the following steps:
>
> 1. Replace every ereg_replace() by mb_ereg_replace() and then run it
> through.
i've tried both functions, ereg_replace and mb_ereg_replace and it still
only works on windows.
another friend of mine also tried the sample script in my previous mail
on fedora core 2, i386 architecture. he has apache 2, php version 4.3.8
(or newer, don't know exactly).
so now i've tested this on windows and it worked. freebsd i386 - no go.
dragonflybsd amd64 - no go. fedora core 2 i386 - no go. please tell me
if you need any detailed info on any if the machines (although i can
promptly reply only for the freebsd (and win) box as it is mine, the
others aren't).
> 2. Run the one-liner below on a shell prompt and include the outout in
> the reply
> to this mail:
>
> ( echo "#include <stdio.h>"; echo "#include <ctype.h>"; echo 'main() {
> int i; for (i = 0; i < 256; i++) { printf("%d", isalnum(i) ? 1: 0); }
> printf("\n"); }' ) > /var/tmp/test.c && gcc -o /var/tmp/test
> /var/tmp/test.c && /var/tmp/test && rm /var/tmp/test.c /var/tmp/test
this is the output on freebsd:
00000000000000000000000000000000
00000000000000001111111111000000
01111111111111111111111111100000
01111111111111111111111111100000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
i'll provide output from dragonflybsd later.
> If http_input equals to internal_encoding then you don't need to turn
> on encoding_translation.
i've tried again with this turned off, just to be sure i didn't mess up
here, but still the same - without the "foreign" characters in
mb_ereg_replace output.
thank you for help!
regards,
McAjvar
--
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php