KBD

Keith Devens .com

Thursday, March 18, 2010 Flag waving
In Iran, we don’t have homosexuals like you do in this country. – Mahmoud Ahmadinejad (speech at Columbia University, 9/24/07)
← 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)
:

March 2010
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 2 posts

Recent comments XML

I hate ASP.NET

I hate ASP... I was doing wonders​with PHP, then suddenly one of my​clients...

Johnies: Mar 17, 6:14am

Quantum physics and free will

I knew you were going to say that....

Tom Massey: Mar 15, 9:26pm

Generated in about 0.102s.

(Used 8 db queries)