ZF-8781: 31.40. Converting numerals from Latin script to Eastern Arabic script won't work
Description
Priority low, I search also myself. but I try the example 31.40. Converting numerals from Latin script to Eastern Arabic script.
converted value = null
see my script test here. http://xp-dev.com/sc/browse/…
Comments
Posted by Thomas Weidner (thomas) on 2010-01-11T23:39:10.000+0000
I can't reproduce your problems.
The given code is not from the manual and example 31.40 works and returns arabic script.
Tried by using "de_AT" which returns 18 scripts and also by using "en" which also returns 18 scripts.
Can you provide us with a screenshot ?
Posted by Christophe Gesché (moosh) on 2010-01-12T11:02:51.000+0000
ok so I've retry.
Zend_Locale::convertNumerals()Zf : <?php echo Zend_Version::VERSION;?>$locale = new Zend_Locale(); Zend_Debug::dump($locale->toString(), 'Locale'); echo 'Original script'; $latinScript = '123'; $arabicScript = Zend_Locale_Format::convertNumerals($latinScript, 'Latn', 'Arab'); print "\nOriginal: " . $latinScript; print "\nLocalized: " . $arabicScript;{quote} Zend_Locale::convertNumerals()
Zf : 1.9.6
Locale string(2) "fr"
Original script
Original: 123 Localized: {quote}
I continue to test myself.
Precision I use Windows. I would make check on iconv and preg_replace
Posted by Christophe Gesché (moosh) on 2010-01-12T11:11:41.000+0000
{quote} iconv iconv support enabled iconv implementation "libiconv" iconv library version 1.9
Directive Local Value Master Value iconv.input_encoding ISO-8859-1 ISO-8859-1 iconv.internal_encoding ISO-8859-1 ISO-8859-1 iconv.output_encoding ISO-8859-1 ISO-8859-1
pcre PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 7.9 2009-04-11
Directive Local Value Master Value pcre.backtrack_limit 100000 100000 pcre.recursion_limit 100000 100000 {quote}
Posted by Christophe Gesché (moosh) on 2010-01-12T12:11:27.000+0000
problem is in both.
{quote} $asource array(2) { [0] => string(5) "/٤/u" [1] => string(5) "/٣/u" }
$atarget array(2) { [0] => string(1) "x" [1] => string(1) "y" }
preg_replace string(6) "yx٥٦"
iconv string(1) "�" <--
ord -> 163
{quote}
Posted by Thomas Weidner (thomas) on 2010-01-12T12:23:35.000+0000
I still don't know where your problems are, nor what you are getting for an output from the manual example, nor what you want to show with this code snippets.
PS: I also used Windows for reproduction. Default installation
Posted by Christophe Gesché (moosh) on 2010-01-12T12:37:37.000+0000
I found a solution but it's in ZF code
in
I just add 'UTF-8' as 4st param of iconv_substr
and all works fine.
Posted by Christophe Gesché (moosh) on 2010-01-12T12:42:14.000+0000
{quote} I still don't know where your problems are, nor what you are getting for an output from the manual example, nor what you want to show with this code snippets. {quote}
OK, sorry.
I just want to show than on my Zend server install on winows
Zend_Locale_Format::convertNumerals return NULL
until I add , 'UTF-8' on 4st param of iconv_substr function. in Zend_Locale_Format::convertNumerals
Posted by Christophe Gesché (moosh) on 2010-01-12T13:09:36.000+0000
Ok I just start my brain.
before the sample and it's work. without change anything in zend framework. But I think it's better to change it.
I tell to continue to test most of example and complete them in my shared project. ZF_Experiences.
Posted by Thomas Weidner (thomas) on 2010-01-12T13:09:40.000+0000
This clearifies why it does not work in your environment.
In my installation UTF-8 is set as default. It seems that within the server installation it is NOT default.
This issue was already fixed for the next minor release (1.10) a few months ago. See the linked issues.
Closing as duplicate.
Posted by Thomas Weidner (thomas) on 2010-01-12T13:10:49.000+0000
You can use 1.10pre or trunk to have a fixed version.
Posted by Thomas Weidner (thomas) on 2010-01-12T13:21:04.000+0000
Christophe: As said... this has already been fixed in past and it will be released with the next release. We can't throw out releases each two weeks ;-)