Bug #69179 [NEW]: The problem is in string length with RTL languages

From: Date: Wed, 04 Mar 2015 07:53:28 +0000
Subject: Bug #69179 [NEW]: The problem is in string length with RTL languages
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191122@lists.php.net to get a copy of this message
From:             rm dot nasir at hotmail dot com
Operating system: Windows 8.1 Enterprise 32bit
PHP version:      5.5Git-2015-03-04 (snap)
Package:          Strings related
Bug Type:         Bug
Bug description:The problem is in string length with RTL languages

Description:
------------
Hi!

I got a problem with my PHP 5.5.12 which I got with WAMP Server.

PROBLEM:
  When I want to return the length of an Arabic string value it is not
showing the exact length of the characters I wrote in that string PHP is
increasing the length.

Test script:
---------------
header('Content-Type: text/html; charset=utf-8;');

// demo string by Pashto language
$myText = "دا يوه جمله ده";

// length of the string above is 14 characters
// you can test it with JavaScript in your browser console
// and that is returning the exact length 14 but in PHP
// it is showing 25

echo strlen( $myText ); // 25

// I also tested it with

var_dump( $myText ); // string 'دا يوه جمله ده'
(length=25)


-- 
Edit bug report at https://bugs.php.net/bug.php?id=69179&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69179&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69179&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69179&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69179&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69179&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69179&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69179&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69179&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69179&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69179&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69179&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69179&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69179&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69179&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69179&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69179&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69179&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69179&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69179&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69179&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#191122) next »