Forums / Addon Language Packs / UTF8 and Number

UTF8 and Number

Locked

Started by nnitin on 22 Nov 2008, 5:09 AM · Views: 2,881

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
22 Nov 2008, 5:09 AM
#1
nnitin avatar

nnitin

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

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

22 Nov 2008, 8:04 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

24 Nov 2008, 4:03 AM
#3
nnitin avatar

nnitin

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

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

24 Nov 2008, 9:14 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

24 Nov 2008, 12:14 PM
#6
nnitin avatar

nnitin

New Zenner

Join Date:
Oct 2008
Posts:
31
Plugin Contributions:
0

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