python-minifier icon indicating copy to clipboard operation
python-minifier copied to clipboard

Minifer returns gibberish for escaped strings...

Open ImInTheICU opened this issue 10 months ago • 4 comments

print("\xd0\x9f\xd1\x80\xd0\xbe\xd1\x84\xd0\xb5\xd1\x81\xd1\x81\xd0\xb8\xd0\xbe\xd0\xbd\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd0\xb0\xd1\x8f") Which decoded to utf-8 gives Профессиональная (Professional) When ran using the minifier it returns print('Ð\x9fÑ\x80оÑ\x84еÑ\x81Ñ\x81ионалÑ\x8cнаÑ\x8f')

ImInTheICU avatar Feb 28 '25 17:02 ImInTheICU

The output is the same string, but in a more compact representation.

dflook avatar Feb 28 '25 17:02 dflook

The output is the same string, but in a more compact representation.

I tried decoding it just like I did with the top output and it failed to decode.

ImInTheICU avatar Feb 28 '25 18:02 ImInTheICU

Do you have a larger example that shows how it isn't working? How is it being decoded?

As far a python is concerned they are the same string:

>>> 'Ð\x9fÑ\x80оÑ\x84еÑ\x81Ñ\x81ионалÑ\x8cнаÑ\x8f' == "\xd0\x9f\xd1\x80\xd0\xbe\xd1\x84\xd0\xb5\xd1\x81\xd1\x81\xd0\xb8\xd0\xbe\xd0\xbd\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd0\xb0\xd1\x8f"
True

Are you running on windows by any chance?

dflook avatar Feb 28 '25 18:02 dflook

I am. Windows 11 - 24H2.

ImInTheICU avatar Mar 01 '25 18:03 ImInTheICU