Mercurial > hg > cc > cirrus_work
view bin/percent_encode.py @ 91:460f0599e8cd
mostly working, but need to reorder in case of cfid and friends
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Tue, 05 Sep 2023 17:32:46 +0100 |
| parents | 1daa8e444cfe |
| children |
line wrap: on
line source
'''Handle unquoting of non-UTF-8 bytes by %-encoding them''' import codecs def percent_encode(ude): #print(ude.object,ude.object[ude.start:ude.end]) return (''.join('%%%X'%c for c in ude.object[ude.start:ude.end]), ude.end) codecs.register_error('percent',percent_encode)
