ftfy-web icon indicating copy to clipboard operation
ftfy-web copied to clipboard

Bug: pasting `v¾¾r` or using https://ftfy.vercel.app/?s=v%C2%BE%C2%BEr inserts `Â` before each `¾` and comes up with the wrong solution.

Open jpluimers opened this issue 3 years ago • 2 comments

Pasting v¾¾r or using https://ftfy.vercel.app/?s=v%C2%BE%C2%BEr inserts  before each ¾ and wrongly results in this:

s = 'v¾¾r'
s = s.encode('latin-1')
s = s.decode('utf-8')
print(s)

then prints v¾¾r (which it started with)

The actual solution should be this:

s = 'v¾¾r'
s = s.encode('cp850')
s = s.decode('latin-1')
print(s)

printing vóór.

Related: https://github.com/rspeer/python-ftfy/issues/18#issuecomment-1175084299

jpluimers avatar Jul 05 '22 13:07 jpluimers

Ran into this today with unicode that had been misencoded as some sort of ascii:

Clipboard viewer for OS X that allows extracting the data in ...

Superuser
https://superuser.com â.º questions â.º clipboard-viewer-f...
Jan 24, 2013

nightpool avatar Dec 19 '23 16:12 nightpool

Ran into this today with unicode that had been misencoded as some sort of ascii:

Clipboard viewer for OS X that allows extracting the data in ...

Superuser
https://superuser.com â.º questions â.º clipboard-viewer-f...
Jan 24, 2013

To determine if this is related to this issue, can you please post links to:

  • the original superuser page you used
  • the ftfy vercel app link you tried to correct the Mojibake

jpluimers avatar Jan 25 '24 11:01 jpluimers