#31324 [Csd->Bgs]: function strlen miscounts

From: Date: Thu, 30 Dec 2004 14:32:01 +0000
Subject: #31324 [Csd->Bgs]: function strlen miscounts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71302@lists.php.net to get a copy of this message
 ID:               31324
 Updated by:       rasmus@php.net
 Reported By:      phpbug at tore dot cc
-Status:           Closed
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: Solaris 10
 PHP Version:      5.0.2
 New Comment:

There is no bug here, hence the bogus status.

Here is the reference in the docs linked from php.net/mbstring:

http://php.net/manual/en/ref.mbstring.php#mbstring.overload

Does that count as documentation?


Previous Comments:
------------------------------------------------------------------------

[2004-12-30 14:53:59] phpbug at tore dot cc

I don't count 'php.ini' to documentation. Anyway thanks for the time.

------------------------------------------------------------------------

[2004-12-30 14:44:56] rasmus@php.net

Did you read the documentation?

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0

------------------------------------------------------------------------

[2004-12-30 14:33:30] phpbug at tore dot cc

I have traced down the trouble.
When multibyte strings support is complied in to php the internal
function 'strlen' is aliased to the function 'mb_strlen'.
mb_strlen counts the number of characters in the binary string
depending of what default encoding is used.

I have set the default chars to UTF-8 and SJIS (japanese) on my sparc
machine. That is why I only see it there.

Please remove the aliasing between strlen and mb_strlen!

------------------------------------------------------------------------

[2004-12-30 10:55:57] derick@php.net

It's impossible to extract that code from PHP, and as we don't have
access to a solaris machine we can not really debug this.

------------------------------------------------------------------------

[2004-12-29 23:22:50] phpbug at tore dot cc

Are 64bit processors not supported by php?
Which machine architecture is 'my system'?

The php is compiled with gcc2 AND gcc3. With solaris 9 AND solaris 10.
The same trouble occurs.
So I need to have the code for 'strlen' in php extracted before I can
figure out where the source for the trouble is.

A simple C-program using string.h's strlen cause no troule at all.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/31324

-- 
Edit this bug report at http://bugs.php.net/?id=31324&edit=1


Thread (16 messages)

« previous php.bugs (#71302) next »