Thread: UTF8 and Number

Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    31
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default 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.
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

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

  3. #3
    Join Date
    Oct 2008
    Posts
    31
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Oct 2005
    Location
    Finland
    Posts
    173
    Plugin Contributions
    1

    Default 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.

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default 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.
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

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

  6. #6
    Join Date
    Oct 2008
    Posts
    31
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. UTF8 and ASCII PHP files Probles?
    By nnitin in forum Addon Language Packs
    Replies: 2
    Last Post: 24 Oct 2008, 12:47 AM
  2. made products_description table utf8 compatible?
    By soki in forum General Questions
    Replies: 2
    Last Post: 22 May 2008, 06:22 PM
  3. UTF8 problems with Advanced Search
    By saskvo4 in forum Addon Language Packs
    Replies: 8
    Last Post: 16 Jan 2008, 09:35 AM
  4. Replies: 3
    Last Post: 4 Sep 2007, 01:06 PM
  5. mysql utf8 re-import shows meaningless characters
    By reza in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 31 May 2007, 01:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •