I browsed the Internet and cannot find a solution to the problem that I am facing. I am trying to use Zend_Currency to get currency for China like this:
$currency = new Zend_Currency('CN');
However, I keep getting the following error:
Fatal error: Uncaught exception 'Zend_Currency_Exception' with message 'No region found within the locale 'zh'' in /Library/WebServer/Documents/vendor/zendframework/zendframework1/library/Zend/Currency.php on line 561
This is a new installation of Zend Framework 1.12.3, and as far as I know, I am not doing anything wrong here. From the error, I see that Zend maps the country code to the locale.
This is a problem since my application relies on getting currency information from the country code. I have no problem with GB, US, etc.
I looked at Zend/Locale/Data and I can confirm that there are locale files zh.xml , zh_CN.xml , but I admit that I am not 100% what I am looking for in everyone!
Does anyone have any idea that this is a problem and how can I fix it?
thanks
EDIT:
This is a change to discuss comments.
It seems that Zend_Locale returns zh if the CN country code is given, rather than the expected string zh_CN . This means that I cannot find anything consistent to go to Zend_Currency to avoid errors.
James source share