KBD

Keith Devens .com

Tuesday, December 2, 2008 Flag waving
The three chief virtues of a programmer are: Laziness, Impatience and Hubris. – Larry Wall (Programming Perl)
← Social software -- the "social interface"Styling form controls →

Daily link icon Monday, October 4, 2004

Sam Ruby: PHP and Unicode

Sam Ruby: PHP and Unicode. I haven't had a problem, and my site's in PHP and does Unicode (example). Everything's stored everywhere as UTF-8 (The One True Unicode Encoding).

Personally, I kind of like knowing that my data are just bags of bytes, as PHP strings currently are. PHP has extensions to do any Unicode heavy-lifting, like doing character set or encoding conversions, so I'm not really lacking there. One thing I really should be doing is sanitizing all my input to protect myself from non-UTF-8 data, but that's not a PHP-specific thing. If I get non-UTF-8 data in Python, the code will throw an exception and I have to handle that, but it's harder because Python doesn't let you break the string abstraction and get at the bytes easily (at least, not that I know how to). PHP will just carry on and I can do something to fix the problem wherever (so long as I check for it).

← Social software -- the "social interface"Styling form controls →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

December 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 6 posts

Recent comments XML

new⇒Perl 6 1.0 in March?

Doh, my mistake. I'm aware of the​relation between Parrot and Rakudo​but I'...

Keith: Dec 2, 1:03am

Free image hosting sites

Well, TinyPic has this in its​FAQ:

> Images and videos is in​your accoun...

Keith: Dec 1, 1:13am

Join a NameValueCollection into a querystring in C#

Well with a lamba expression, this​is what I came up​with:

?!code:csharp...

Gustaf Lindqvist: Nov 30, 4:38pm

Why no generic OrderedDictionary?

Check​http://www.codeproject.com/KB/recip​es/GenericOrderedDictionary.aspx?d...

Gabrielk: Nov 27, 6:57am

WhatIsMyIP.com

http://www.thesysteminfo.com is​another good alternate to​whatismp.com... I...

Kripz: Nov 26, 8:51pm

Girls, please don't get breast implants

Actually I think it's sweet when a​man loves a woman whether she's big​or n...

218.186.12.228: Nov 26, 9:40am

Generated in about 0.227s.

(Used 8 db queries)

mobile phone