[PHP-DEV] {add,strip}cslashes Q - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-10-01 Thread Rolland Santimano
> [3] string addcslashes(string text, string charlist) > [4] string stripcslashes(string text) > Escape chars < 32 or > 126 with octal sequences, and escape > characters from charlist with backspace. Escaping chars/codepts with values > 126 is a pblm in Unicode strings. Using the 3-digit octal esc

[PHP-DEV] RE: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-09-02 Thread Tex Texin
clarification - Re: [PHP-DEV] PHP > Unicode strings impl proposal > > > --- Andrei Zmievski <[EMAIL PROTECTED]> wrote: > > > > >> 4) The string can be truncated to the user's requested character > > >> length. The string will be trimmed from t

[PHP-DEV] Re: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-09-01 Thread Rolland Santimano
--- Andrei Zmievski <[EMAIL PROTECTED]> wrote: > > >> 4) The string can be truncated to the user's requested character > >> length. The string will be trimmed from the right one unicode > >> utf-8 character (not grapheme, not byte) at a time until the length > >> limit is met. (So a combining char

[PHP-DEV] Re: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-09-01 Thread Andrei Zmievski
On Sep 1, 2005, at 6:32 AM, Rolland Santimano wrote: 4) The string can be truncated to the user's requested character length. The string will be trimmed from the right one unicode utf-8 character (not grapheme, not byte) at a time until the length limit is met. (So a combining character is on

[PHP-DEV] RE: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-09-01 Thread Rolland Santimano
> So for reasons of performance, simplicity, and practicality, I would > say str_pad should: > > 1) of course surrogates must not be broken up > 2) The pad string can have combining characters. > 3) The length the user specifies should be a character count. I presume that "character" above refers

RE: [PHP-DEV] RE: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-08-29 Thread Tex Texin
27; > Subject: Re: [PHP-DEV] RE: str_pad clarification - Re: > [PHP-DEV] PHP Unicode strings impl proposal > > > Does this mean that if the padding string is base character + two > combining characters, we can trim just one of the combining > ones or do > we trim all the

Re: [PHP-DEV] RE: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-08-29 Thread Andrei Zmievski
Does this mean that if the padding string is base character + two combining characters, we can trim just one of the combining ones or do we trim all the way back to the base one? -Andrei On Aug 29, 2005, at 5:50 AM, Tex Texin wrote: 4) The string can be truncated to the user's requested char

[PHP-DEV] RE: str_pad clarification - Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-08-29 Thread Tex Texin
-Original Message- > From: Rolland Santimano [mailto:[EMAIL PROTECTED] > Sent: Monday, August 29, 2005 1:37 AM > To: Tex Texin > Subject: str_pad clarification - Re: [PHP-DEV] PHP Unicode > strings impl proposal > > > --- Andrei Zmievski <[EMAIL PROTECTED]> w

Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-08-25 Thread Andrei Zmievski
On Aug 23, 2005, at 11:31 PM, Rolland Santimano wrote: I meant that 'start'/'length' would be UChar counts and probably fall in the middle of a lead/trail sequence. But as you mentioned below, the iteration macros should take care of that. start/length parameters should always be interpreted i

Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-08-23 Thread Rolland Santimano
--- Andrei Zmievski <[EMAIL PROTECTED]> wrote: > On Aug 23, 2005, at 8:23 AM, Rolland Santimano wrote: > > [1] string substr_replace > > Impl: > > The current impl is written in terms of memcpy(), after adjusting > > satrt & length correctly. With Unicode input, 'start' & 'length' > > may not be al

Re: [PHP-DEV] PHP Unicode strings impl proposal

2005-08-23 Thread Andrei Zmievski
On Aug 23, 2005, at 8:23 AM, Rolland Santimano wrote: [1] string substr_replace(string original, string new, int start[, int length]) Returns string where original[start..length] is replaced with new. Input args can be arrays, in which case case the operation is: substr_replace(original[i], new[i

[PHP-DEV] PHP Unicode strings impl proposal

2005-08-23 Thread Rolland Santimano
Comments / impl suggestions please. TIA, Rolland -- [1] string substr_replace(string original, string new, int start[, int length]) Returns string where original[start..length] is replaced with new. Input args can be arrays, in which case case the operation is: substr_replace(original[i], new[i],