Re: multi-byte awareness for formatted_print.c

From: Date: Tue, 09 Oct 2001 22:11:38 +0000
Subject: Re: multi-byte awareness for formatted_print.c
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67644@lists.php.net to get a copy of this message
["Wez Furlong" <wez@thebrainroom.com>] > Hi, > > I was wondering if there are any plans to mutli-byte enable the formatted > print family of functions in formatted_print.c? > > The reason that I ask is that I have just run into a case where it incorrectly > deals with a % sign in some multi-byte text. > > A possible solution might be to code a generic multibyte string walking > function in the mb_string extension that, given a point to a multi-byte > string, returns the wide character at the current position and advances the > pointer to the next wide-character. I think there is such a function in > multi-byte aware libc, but that's not always available, so I suggest an > implementation in mbstring. > > I've already written some code that effectively does this in html.c for > htmlentities and htmlspecialchars. > > Any comments/suggestions? What about using a typedef or #define to define a "phpchar" type that is used in all such functions instead of "char"? Or would it be too inflexible to determine this at compile time? - Stig -- Stig Sæther Bakken <ssb@alltheweb.com> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.dev (#67644) next »