KBD

Keith Devens .com

Thursday, May 17, 2012 Flag waving
Есть Два Цвета: Черный И Белый, А Есть Оттенки, Которых Больше. ('There are two colors: black and white. Others are just shades.') – unknown
← 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)
:

May 2012
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



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

Recent comments XML

new⇒Acknowledging the Arrival of Peak Government

In many ways, Peak Oil is​responsible for this new​uselessness of the big g...

Revence: May 16, 6:35am

new⇒Tab EXSPLOSION

Right now, I, too, have too many​tabs open. A rough count says​25.
Right. ...

Revence: May 16, 6:21am

George W. Bush: ‘I’m for Mitt Romney’ - ABC News

A marked difference (departure,​even) from the KBD of eight--yea,​even four...

Revence: May 15, 1:55pm

WebOb — WSGI request and response objects

Google App Engine forces one to​learn these....

Revence: May 15, 1:52pm

Generated in about 0.179s.

(Used 8 db queries)