Summary | Patch to make File_PDF work with mbstring.func_overload |
Queue | Horde Framework Packages |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Not A Bug |
Priority | 2. Medium |
Owners | |
Requester | mike (at) silverorange (dot) com |
Created | 02/06/2009 (5995 days ago) |
Due | |
Updated | 02/06/2009 (5995 days ago) |
Assigned | 02/06/2009 (5995 days ago) |
Resolved | 02/06/2009 (5995 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
State ⇒ Not A Bug
encodings. Pragmatically, using mbstring.func_overloading is the best
way to develop a UTF-8 application in PHP.
streams. Usually in this case you want to work with bytes and not
characters. The attached patch explicitly uses bytes (the '8bit'
encoding) for string calculations in a binary context if mbstring
function overloading is enabled.
Undesired side-effects, and yet more hacks to work around stuff being
broken by the hack called overloading.
encodings. Pragmatically, using mbstring.func_overloading is the best
way to develop a UTF-8 application in PHP.
When mbstring.func_overloading is enabled, the string functions treat
strings a sequence of characters, not bytes. Usually, this is desired,
as you wouldn't want to truncate a string part way through a
multi-byte character.
When this is not desired is when you are working with binary files or
streams. Usually in this case you want to work with bytes and not
characters. The attached patch explicitly uses bytes (the '8bit'
encoding) for string calculations in a binary context if mbstring
function overloading is enabled.
State ⇒ Feedback
string functions are already replaced by the mbstring variants. That's
the whole purpose of that functionality, so there is no need to do
this explicitly in wrapper methods.
Beside that, mbstring function overloading is evil and should be
removed from the face of this earth completely.
New Attachment: file-pdf-mbstring.diff
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Patch to make File_PDF work with mbstring.func_overload
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ Yes
State ⇒ Unconfirmed
functions get overloaded with multi-byte character versions. Since
these functions are used to do byte calculations in File_PDF, using
mbstring.func_overload breaks File_PDF. The attached patch makes
File_PDF work even with mbstring.func_overload is used.