View Full Version : Bug: Tag cannot works
jdleung
06-26-2007, 03:56 PM
I tried to insert tags for an image, English works. But it refused to insert Chinese. If I write a tag: "标签_tag_中文", the database will be saved as "_tag_". If I insert the tag directly using phpmyadmin, the Chinese will be displayed in mess.
What's wrong here?
Dkozikowski
06-26-2007, 04:00 PM
what do those symbols represent?
As far as I know, and it's not much, I was not aware that programing languages accepted characters as such.
jdleung
06-26-2007, 04:17 PM
Admin->edit image
http://www.jdleungs.com/download/edit_image.jpg
the tags should contain chinese words at the begining and the end. the chinese word seems cannot insert into database and cannot be displayed.
Dkozikowski
06-26-2007, 04:20 PM
Ok, i see. so they are not being saved to the database correctly.
We'll take a look into this. thanks for pointing it out.
jdleung
06-26-2007, 04:24 PM
Not only saving problem but also displaying problem. because I had tried to write chinese directly into database via phpmyadmin, but it displays in a mess.
dakwegmo
06-26-2007, 04:29 PM
I tested this in a dev environment. When I am editing an image, if I enter any chinese characters into the tag field, they don't make it into the database. I can enter chinese in the title or description fields and they go through just fine and everything gets inserted. (Though if you look at the DB in phpMyAdmin the characters look like this: æ ‡ç¾_tag_䏿–‡).
Also, if I enter the tag via phpMyAdmin, the characters are displayed just fine too, but in the DB they converted into character escapes like this: 标签_tag_中文.
Dkozikowski
06-26-2007, 04:31 PM
Not only saving problem but also displaying problem. because I had tried to write chinese directly into database via phpmyadmin, but it displays in a mess.
ok, thanks.
Just to verify, this is only an issue on the edit page?
The new image page works as it should?
Or is this just a tag specific issue on all pages where tags are edited / added
jdleung
06-28-2007, 02:12 PM
ok, I add this in function save_tags_new
$pat1 = '/([^\x00-\xff][^a-zA-Z 0-9_-]+)/';
it works fine.
but another problem, the chinese tag link looks like this
/index.php?x=browse&tag=%E6%A0%87%E7%AD%BE
it means $_GET['tag']= "%E6%A0%87%E7%AD%BE", so it doesn't work when click a chinese tag link.
how can I judge if the tag is chinese or english? urldecode function? but if a tag has chinese and english, the tag link will look like this:"%E6%98%AF%E7%9D%A1english_tag". How can I only pick the chinese out? and decode it? and then put them together again so that the tag can be search from the database?
thanks.
As I was a creator of tag support and didnt know any fine working solution supporting special chars for it then I added support only for text using a-zA-Z 0-9_- marks.
If you know any good solution for putting it into the url and picking it back from it for DB search process then feel free to PM me with few example links.
jdleung
06-30-2007, 02:52 PM
Geos, I get it works. I'll PM you the link.
So maybe Ill give a try to it and install it at my site for a while. We will see.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.