lcorbasson / piwigo-cron

GNU General Public License v2.0
0 stars 0 forks source link

piwigo 2.9.3 does not convert spaces #1

Open unnilennium opened 6 years ago

unnilennium commented 6 years ago

if a folder to an image has space in it, pydio does not convert it to %20 using the script fails for images in this folder

solution

python_script="import json

s = '$json' j = json.loads(s)

for url in j['result']['urls']: print(url.replace(' ', '%20')) "

unnilennium commented 6 years ago

similarly if a folder path to an image contains accentuated characters it is unicode converted, but python thinks this is ascii.

you need to

python_script="import json

s = '$json' j = json.loads(s)

for url in j['result']['urls']: print(url.encode('utf-8').replace(' ', '%20')) "