Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15411357
D17188.id41336.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
399 B
Referenced Files
None
Subscribers
None
D17188.id41336.diff
View Options
diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -256,7 +256,10 @@
* @return int The character length of the string.
*/
function phutil_utf8_strlen($string) {
- return strlen(utf8_decode($string));
+ if (function_exists('utf8_decode')) {
+ return strlen(utf8_decode($string));
+ }
+ return count(phutil_utf8v($string));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 9:09 AM (1 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705954
Default Alt Text
D17188.id41336.diff (399 B)
Attached To
Mode
D17188: Fall back to from utf8_decode to phutil_utf8v for codepoint counting
Attached
Detach File
Event Timeline
Log In to Comment