Fwd: String/Bytes Problem in layout2layout.py
José Abílio Matos
jamatos at lyx.org
Mon Jan 3 15:16:47 UTC 2022
On Monday, 3 January 2022 14.55.53 WET Pavel Sanda wrote:
> If I get that right the part of the "..." -> b"..." should be committed to
> 2.4?
>
> Pavel
Good point. Yes, it should (I thought that it already was) specially in order
to be consistent with all the other code that already does that.
The issue is that in Python 2 str (string type) does not has an encoding
associated, later there was a new string type (unicode) where the string has
an encode associated.
In Python 3 strings become encoding aware and the previous strings were
renamed bytes. So b"..." (bytes string) is a no-op in Python 2, because it
corresponds to "...". Similarly u"..." (unicode string) is a no-op in Python 3
since it corresponds to "...".
If you want I can take care of that, in 2.4, and see if there are cases where
the conversion is missing.
@Riki: is it possible to have a layout file such that the encoding is not
utf-8?
--
José Abílio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220103/3c3da225/attachment.html>
More information about the lyx-devel
mailing list