[dev] Re: [cvs] commit: horde/lib/MIME Message.php

Jan Schneider jan at horde.org
Sat Feb 1 11:29:47 PST 2003


Zitat von Chuck Hagenbuch <chuck at horde.org>:

> Quoting Jan Schneider <jan at horde.org>:
> 
> > "Use the other String:: equivalents of PHP string functions to
> > manipulate strings correctly according to the current (or specified)
> > character set but use the PHP functions for code/machine processed
> > strings."
> >
> > I'd love to elaborate on this if it's not clear to everyone what I
> wrote
> > there. :-)
> 
> That part makes sense. I wasn't sure if an email, potentially in the
> user's
> charset, was user input or a machine processed string.

That wasn't the reason for this change. But you wanted to check if the last
character of a string was a newline. A newline character is always one byte
long, regardless of the string's charset. Thus substr($string, -1) is always
safe, if you want to check the $string's last byte against a single byte
character.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the dev mailing list