When I'm trying to put metadata (title, description) in Russian I'm getting them back as a garbage.
Here is what I see in the ftitle field of the news_webfm_file table: '%D0%BA%D1%83-%D0%BA%D1%83'
Thank you.
When I'm trying to put metadata (title, description) in Russian I'm getting them back as a garbage.
Here is what I see in the ftitle field of the news_webfm_file table: '%D0%BA%D1%83-%D0%BA%D1%83'
Thank you.
Comments
Comment #1
robmilne commentedThe metadata in the webfm_file table is 'escaped' via the javascript encodeURIComponent() function. WebFM decodes the metadata via the javascript unescape() function. The php function to decode is urldecode - see the webfm_fdesc() class in webfm.module.
Comment #2
Sensor commentedNothing wrong with storing data in the escaped form (however little bit strange since the Russian filename saved in raw utf8).
The problem is that I'm getting garbage in the metadata edit form...
I.e. I enter title in Russian, Submit it, close the metadata edit form, then open it again, and see garbage in the title field. I've test this in both FF and IE.
I saw that same issue appeared in previous versions, but promised to fixed in 2.5 - http://drupal.org/node/210199.
Thank you.
Comment #3
Sensor commented-I know kung-fu! (c) Neo@Matrix :)
In the js/webfm.js in the HEAD on lines 2268 and 2277
You are using the unescape function which is not utf friendly according to the documentation. unescape function does not take four digits hexadecimal entities %XXXX, but takes only two digits.
Changing unescape to decodeURI fixes the issue.
Comment #4
robmilne commentedThanks for that. I'll commit this change to head immediately.
Comment #5
robmilne commentedComment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.