-
UTF8 and Number
Hi All,
I am trying to customize zencart with UTF8. As far as displaying information, search etc everything goes well except Numbers
In Customer Registration form, if a user gives dates in UTF8 (like Hindi) language format it can not recognize it as proper date. It has to be in English.....why is it like that? Is it that all number should be in English?
Is there any solution to this behaviour?
Regards,
nnitin
-
Re: UTF8 and Number
The numbers that you describe as English (1,2,3, ...) are not actually so. They are in fact originally from Arabic, but proved so useful that they have been adopted and used not only by Western languages, but also many Eastern languages, even those where there are longer-established alternatives (e.g. Japanese).
From your post Hindi would seem to be an exception to this. Dates will still need to be held in "standard international format" in the database, i.e. "yyyy-mm-dd", but you may be able to convert what visitors to your site see by changing the date functions in your hindi.php language file.
These are the functions that convert those internal dates into say mm/dd/yyyy for Americans and dd/mm/yyyy for most other people and can hopefully be adapted to convert them into hindi format too.
-
Re: UTF8 and Number
Dear Kuroi,
Yes! I do understand that there should not be any change if I am using numbers in any language. But it is happening here. If I give ११/२४/१९७० which reads in English as 11/24/1970 it gives me error. If I give २४/११/१९७० which reads in English as 24/11/1970 even then it gives error. If I input the date in 11/24/1970 in English it accepts.
I do not think it is due to dd/mm/yyyy or mm/dd/yyyy.
What could be the reason?
Regards,
nnitin
-
Re: UTF8 and Number
Hi nnitin,
does this Wiki help you customize the date behaviour in your Hindi language file: http://www.zen-cart.com/wiki/index.php/Date_Format ?
Guess you need to customize code even more, but it should be doable in the same areas.
-
Re: UTF8 and Number
Hi nntin
Unfortunately you haven't said what the error is, so it's difficult to say why it might be ocurring.
However if I enter 24/11/1970 into a site where I haven't adapted the zen_date_raw() function then I get an error too, even for a site completely built in (non-American) English.
Rued's link provides a very clear an helpful guide on this if you haven't already done so.
-
Re: UTF8 and Number
Hi Kuroi,
The error is the one trapped by the program. "The date format is not correct". But it is occurring for both the formats for my language.
I am confused because it works well for English numbers.
Regards,
nnitin