bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53236: 26.1; encode-coding-string does not encode the string as expe


From: Eli Zaretskii
Subject: bug#53236: 26.1; encode-coding-string does not encode the string as expected
Date: Fri, 14 Jan 2022 08:55:30 +0200

> From: Markus Triska <triska@metalevel.at>
> Date: Thu, 13 Jan 2022 20:45:57 +0100
> 
> Correspondingly, I expect (encode-coding-string "\200" 'utf-8) to yield
> a string equivalent to "\xC2\x80", but that seems not to be the case. I get:
> 
>     (encode-coding-string "\200" 'utf-8) --> "\200"
> 
> And therefore, unexpectedly:
> 
>     (string= (encode-coding-string "\200" 'utf-8) "\xC2\x80") --> nil

"\200" is a unibyte string, and encoding unibyte strings returns those
strings without changing them.

This is not a bug, just a dark corner of encoding/decoding stuff.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]