yamdwe icon indicating copy to clipboard operation
yamdwe copied to clipboard

The problem of coverting filename with the Chinese character

Open mintow opened this issue 6 years ago • 0 comments

My MediaWiki has so many pages with Chinese character. Running yamdwe.py, and I got an error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 5: ordinal not in range(128)

I added some code as follow: dokuwiki.py about L87 full_title = full_title.decode('utf-8') wikicontent.py about L180 pagename = pagename.decode('utf-8') text = text.decode('utf-8')

And I got another error:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

I think it's because of the Chinese character in pagename/titlename. I also failed when replace the decode() with urllib.quote(), Do you have any other suggestions?

mintow avatar Aug 28 '18 11:08 mintow