
clint at traveljury
May 23, 2008, 4:12 AM
Post #2 of 4
(634 views)
Permalink
|
|
Re: Bug: Character sets and $r->custom_response
[In reply to]
|
|
> For now, I plan to just entity escape anything that isn't in the ASCII > range, but is there a workaround? Should this be fixed? For those looking for an easy workaround for this, this is what I've used: $output = Encode::encode('iso-8859-1',$output,Encode::FB_HTMLCREF); To explain: - $output contains the full HTML page that I'm passing to $r->custom_response - This, of course, includes < > characters, so you don't want to do a straight encode_entities - So the above command tries to convert the string to ISO-8859-1 - The last argument tells encode that, when it finds a character that it can't represent in ISO-8859-1, it should replace it with the relevant HTML entity. Clint
|