this is pretty easy to do
it has to do with a php function called .htmlentities this will automatically reformat what you type and can cause big problems with multi byte character sets
so if you are seeing "e& ..etc when you type in a name or comment for a picture then this is what you need to do
just find and replace on every file in the admin folder
(i think author of phpwebgallery should start using this as default as i think .htmlspecialchars is much better to use)
tested on PhpWebGallery 1.3.4
always make a backup of your files and mysql database before trying any mod
here is sample
**link dead**
----------------------------- admin - picture_modify.php , infos_images.php , cat_modify.php ----------------------------- (in your admin directory, picture_modify.php , infos_images.php , cat_modify.php and replace all that you find below i would use a program to just do search and replace) Find: .htmlentities Replace: .htmlspecialchars this will allow you to submit other language to mysql database without errors like &"e showing up rather then what you typed! and dont forget to set your charset in english.php note i used shift_jis since im viewing japanese you would set it to what you use ----------------------------- language / english.php ----------------------------- Line 158 Find: $lang['charset'] = 'iso-8859-1'; Replace: $lang['charset'] = 'SHIFT_JIS';
Last edited by hakrz1 (2005-01-03 06:16:40)
Offline
please, take a look at Unicode support and tell me if it wouldn't be better to set the encoding (and not the charset I made a mistake) to utf-8.
Offline
utf-8 doesn't work too well with Japanese for some reason (some characters get messed up) i have tried many methods to get Japanese to work right (even utf-8) but the best solution i found was to change
.htmlentities
with
.htmlspecialchars
in these files picture_modify.php , infos_images.php , cat_modify.php
its easy to do also
ie
$query.= "'".htmlentities( $_POST['name'], ENT_QUOTES )."'";
$query.= "'".htmlspecialchars( $_POST['name'], ENT_QUOTES )."'";
everything else can remain the same :)
it was fast and i haven't noticed any problems using .htmlspecialchars i would assume it would work for any multi-byte language and even non multi-byte language(s) since its supposed to preserve their meanings. where htmlentities are translated
i could see how htmlspecialchars might have problems with ",\;*? and other weird characters that might conflict with phpcode though ..i haven't really tried to break it yet
so far it works great
http://www.php.net/manual/en/function.h … lchars.php
i have always had problems with .htmlentities in one way or another
all non admin pages display fine with just setting the charset in english.php
Last edited by hakrz1 (2004-12-12 10:55:33)
Offline