wrong date format in search pages

vincent3569 Member, Translator
hello
i've a problem of wrong date format in search pages.

Accentuated letters are well encoded in all files except the words treated in the variable "%1$s" in the following code of search.php :
`
echo ''.sprintf(gettext('Total matches for %1$s: %2$u'), $searchwords, $total).'
'
`
example : when i'm looking to my archives, I've follow the link "décembre 2009".
The page "http://vincent.bourganel.free.fr/zenphoto/index.php?p=search&date=2009-12" is uploaded.
The "é" of "décembre" is not correctly encoded : the file returns "Total des résultats pour décembre 2009 : 10".

What should I do to solve the problem ?

Thanks a lot for help.

Comments

  • Date formatting is controled by your PHP installation. What has setup said about anything having to do with translations and internal encodings?
  • vincent3569 Member, Translator
    hello

    i'am with the french ISP Free.
    i don't have installed PHP on my website.
    the dates are correct on my site, except on the search page.

    how can i see the PHP's parameters of encoding date ?
  • acrylian Administrator, Developer
    Did you maybe modify the search page and saved it in a wrong encoding accidentally. There are several things that can cause this.
    - the php setting (look what setup says for example or look at your phpinfo)
    - the encoding of the file
    - the encoding set in the head of the file (which is taken from the backend option)
  • vincent3569 Member, Translator
    - the php setting (look what setup says for example or look at your phpinfo)
    there is what setup.php shows to me

    PHP mbstring package [Your internal characater set is ISO-8859-1]
    Warning!
    Setting mbstring.internal_encoding to UTF-8 in your php.ini file is recommended to insure accented and multi-byte characters function properly.

    what is phpinfo ? where is php.ini to modify mbstring.internal_encoding ?

    - the encoding of the file
    - the encoding set in the head of the file (which is taken from the backend option)
    what is the differences between the two things ?

    in the head of the file, i can see this line

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    other fact :
    if i follow a tag with accentuated letters (été - french word for summer), the search page is OK.
    it's only when i follow a month with accentuated letters (décembre - french word for december) that the problem occurs.
  • acrylian Administrator, Developer
    phpinfo: http://php.net/manual/en/function.phpinfo.php

    where is php.ini to modify mbstring.internal_encoding ?
    You have to contact your host if you have access to that or maybe can set this via .htaccess or at all.

    encodings
    ``
    Yes, that is the setting for the html page, but the file content itself can also be in a different encoding, too.

    Also the server itself may operate in another encoding as well.

    But as sbillard said the month names are generated by the PHP on your server. I suggest to contact your host.
  • vincent3569 Member, Translator
    the problem occurs on news page : if the date's format shows the month (25 février 2010 for exemple, in french), the display of the date is incorrect.

    i will follow your instructions
  • acrylian Administrator, Developer
    Please try if this occurs with the Zenpage standard theme. If it does not, the error is not your server but your theme.
  • vincent3569 Member, Translator
    of course, i try it my theme and official theme and the problem occurs with both.
    you can see the problem with this site http://vincent.bourganel.free.fr/zenphotoNB

    there is the phpinfo report on mbstring

    mbstring
    Multibyte Support enabled
    Multibyte string engine libmbfl
    Multibyte (japanese) regex support enabled
    Multibyte regex (oniguruma) version 3.7.1

    mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

    Directive Local Value Master Value
    mbstring.detect_order no value no value
    mbstring.encoding_translation Off Off
    mbstring.func_overload 0 0
    mbstring.http_input pass pass
    mbstring.http_output pass pass
    mbstring.internal_encoding no value no value
    mbstring.language neutral neutral
    mbstring.strict_detection Off Off
    mbstring.substitute_character no value no value

    my ISP don't set a default value.

    and there is the phpinfo report on iconv (the only part who set the ISO-8859-1 value)

    iconv
    iconv support enabled
    iconv implementation glibc
    iconv library version 2.7

    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

    what do you think about that ?
  • acrylian Administrator, Developer
    If your server apparently prefers ISO-8859-1 I suggest to try to set Zenphoto's encoding to that, too.
  • You really should get your server set to UTF-8 somehow. Otherwise you will surely have problems in the long run.
  • vincent3569 Member, Translator
    after contact with my isp Free, they told me there's no access to php.ini to set mbstring.internal_encoding to UTF-8.

    do you have another solution for me ?
Sign In or Register to comment.