Announcement

#1 2004-06-09 12:04:47

rych
Member
2004-05-20
12

Unicode support

These are the steps towards multibyte (utf-8) string support.

The name, author, keyword, description field.
in admin/picture_modify.php and other files:
add the encoding argument to htmlentities(... ,"UTF-8") or remove the call to the htmlentities altogether.
http://php.net/manual/en/function.htmlentities.php

URL encoding
everywhere where a string is added to an $url after "search="
enclose it in function calls htmlentities(urlencode()), e.g.,
&search='.$_GET['search'].
is replaced with
&search='.htmlentities(urlencode($_GET['search'])).

Search form:
in search.php:
replace the preg_split line
with
$words = preg_split( "%[\s,]+%uix", $_POST['search'], -1, PREG_SPLIT_NO_EMPTY);
u is a Unicode modifier, see http://www.php.net/manual/en/pcre.pattern.modifiers.php

Optionally, in the language/<yourlanguage>.php make sure that
$lang['charset'] = 'utf-8';

Optionally, remove fr from language attribute to xmlns in header.vtp if your language isn't French.

That's it.

working Unicode-enabled gallery:
http://rych.dnsalias.com/pwg/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact