[PHP] utf8_decode() not working, conflicts with urlencode()

2011-08-30 Thread Merlin Morgenstern
Hi there, I am having some trouble with utf8_decode(). Somehow the function returns output=input e.g.: $input = '%20%C3%9Cbersetzung%20franz'; $output = utf8_decode($input); echo $input.''.$output; My goal is to decode the utf8, trim the input and encode with urlencode(); This is the string

Re: [PHP] utf8_decode() not working, conflicts with urlencode()

2011-08-30 Thread Per Jessen
Merlin Morgenstern wrote: > Hi there, > > I am having some trouble with utf8_decode(). Somehow the function > returns output=input > > e.g.: > $input = '%20%C3%9Cbersetzung%20franz'; > $output = utf8_decode($input); > echo $input.''.$output; > > My goal is to decode the utf8, trim the input and

[PHP] correct character decoding

2011-08-30 Thread Merlin Morgenstern
Hi there, I am trying to find a solution for decoding the same string from 2 different character sets (UTF-8, Latin-1) Looks like in the case of latin-1 I need to add utf8_encode before to get the same results. Here is an example // utf-8 $input = urldecode('%20%C3%9Cbersetzung%20franz'); $

Re: [PHP] utf8_decode() not working, conflicts with urlencode()

2011-08-30 Thread Merlin Morgenstern
Am 30.08.2011 12:11, schrieb Per Jessen: Merlin Morgenstern wrote: Hi there, I am having some trouble with utf8_decode(). Somehow the function returns output=input e.g.: $input = '%20%C3%9Cbersetzung%20franz'; $output = utf8_decode($input); echo $input.''.$output; My goal is to decode the ut

Re: [PHP] correct character decoding

2011-08-30 Thread Louis Huppenbauer
Why don't you just check if the string is utf8 or not, and change convert it accordingly? $out = trim((mb_detect_encoding($input, 'UTF-8', 'ISO-8859-1') == 'UTF-8' ? $input : utf8_encode($input))); It may not be the most elegant version, but I can't think of anything simpler right now. sincerely

Re: [PHP] correct character decoding

2011-08-30 Thread Merlin Morgenstern
Am 30.08.2011 14:12, schrieb Louis Huppenbauer: Why don't you just check if the string is utf8 or not, and change convert it accordingly? $out = trim((mb_detect_encoding($input, 'UTF-8', 'ISO-8859-1') == 'UTF-8' ? $input : utf8_encode($input))); It may not be the most elegant version, but I

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Tedd Sperling
On Aug 29, 2011, at 4:32 PM, George Langley wrote: > "The One True Brace Style": > > > > Didn't know there was a name for the way I learned to indent! Make sense to > me - looks so much cleaner and less scrolling/printing. > And, I already add a

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Richard Quadling
On 30 August 2011 15:04, Tedd Sperling wrote: > To all: > > I prefer the Whitesmiths style: > > http://rebel.lcc.edu/sperlt/citw229/brace-styles.php > > But "style" is really up to the individual -- what works best for you is the > "best" (unless it's a team effort or the clients demand). > > Che

[PHP] Books on PHP guts

2011-08-30 Thread Larry Garfield
Hi folks. I'm not looking to write new PHP extensions per se, but am looking to better grok the guts of PHP itself. (That's a first step on the way to writing new extensions, though. Gateway drug!) I'm especially interested in the memory/performance implications of various techniques. Are

Re: [PHP] Books on PHP guts

2011-08-30 Thread Daniel Brown
On Tue, Aug 30, 2011 at 13:19, Larry Garfield wrote: > Hi folks.  I'm not looking to write new PHP extensions per se, but am > looking to better grok the guts of PHP itself.  (That's a first step on the > way to writing new extensions, though.  Gateway drug!)  I'm especially > interested in the me

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Robert Cummings
On 11-08-30 11:36 AM, Richard Quadling wrote: On 30 August 2011 15:04, Tedd Sperling wrote: To all: I prefer the Whitesmiths style: http://rebel.lcc.edu/sperlt/citw229/brace-styles.php But "style" is really up to the individual -- what works best for you is the "best" (unless it's a team ef

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread David Harkness
I don't always use braces, but when I do I use Compact Control Readability style. Stay coding, my friends.

RE: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Daevid Vincent
LOLercopter! > -Original Message- > From: David Harkness [mailto:davi...@highgearmedia.com] > Sent: Tuesday, August 30, 2011 12:57 PM > To: Robert Cummings > Cc: rquadl...@gmail.com; Tedd Sperling; php-general@lists.php.net > Subject: Re: [PHP] Code should be selv-maintaining! > > I don'

RE: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Jen Rasmussen
David Harkness ...you must be... the "most interesting coder in the world" ;) -Original Message- From: David Harkness [mailto:davi...@highgearmedia.com] Sent: Tuesday, August 30, 2011 2:57 PM To: Robert Cummings Cc: rquadl...@gmail.com; Tedd Sperling; php-general@lists.php.net Subject: Re

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Richard Quadling
On 30 August 2011 20:09, Robert Cummings wrote: > You're just saying that so Tedd will be your friend!! Come now, let's be > honest with everyone... Whitesmith's is -GLEE! ;) Beauty is in the eye of the beholder. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Jason Pruim
On Aug 30, 2011, at 6:25 PM, Richard Quadling wrote: > On 30 August 2011 20:09, Robert Cummings wrote: >> You're just saying that so Tedd will be your friend!! Come now, let's be >> honest with everyone... Whitesmith's is -GLEE! ;) > > Beauty is in the eye of the beholder. I always

Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Matt Graham
From: David Harkness > I don't always use braces, but when I do I use Compact Control Readability > style. Stay coding, my friends. ...and when you use CCR style, you can sing, "I see a bad brace a-risin'"? -- Matt G / Dances With Crows The Crow202 Blog: http://crow202.org/wordpress/ There is