[Phpmyadmin-devel] Re: japanese-sjis SQL-parser error

Marc Delisle delislma at CollegeSherbrooke.qc.ca
Wed Oct 16 11:20:05 CEST 2002

Robin Johnson wrote:

> On Tue, Sep 24, 2002 at 12:29:35AM +0900, luc wrote:
>>Please try to insert my attached texfile.
>>I think to need new parser for multibyte character
>>with using multibyte functions like mb_strlen().
> Hi Luc and list.
> Sorry about the delay, I've been really busy with university, exams and
> work.
> I have a rough preliminary fix for this inside just the SQL Parser, but it
> made me realize that the same fix should probably be extended to the
> rest of the system as well.
> Problem summary:
> PHP's string functions fail badly on strings containing multibyte (MB)
> characters. This effects EVERY language that uses unicode or other
> encoding schemes.
> Solution:
> Replace ALL string functions in the code (strlen, substr, strpos etc.)
> with a variable $GLOBALS['PMA_MB_functionname'] that is then called.
> Additionally to this, we have a little bit of code that puts the correct
> function name in those variables, depending on the availability (PHP
> version is important here) and the need for multibyte characaters. Eg
> mb_strlen or strlen would go into $GLOBALS['PMA_MB_strlen'] which could
> then be used in the code directly, and handle everything properly.
> Any comments/suggetions/flames on this?

Looks ok to me, but looks like a lot of work, unless we can automate the
source code changes.



More information about the Developers mailing list