Closed dcoshea closed 9 years ago
Can you give an example of the app which uses these codes to switch encoding?
On Thu, Jul 23, 2015 at 05:12:01AM -0700, Sergei Lebedev wrote:
Can you give an example of the app which uses these codes to switch encoding?
I certainly can, mine does: https://github.com/jquast/x84/blob/master/x84/default/common.py#L244-258
I work with a CentOS 6-based appliance that sends these codes to its IPMI Serial-Over-LAN console. ESC % G is seen a few times during CentOS startup and while the CentOS 6 Anaconda installer is starting. I think this is probably just standard CentOS 6 behavior rather than anything set up specifically for this appliance. I also see ESC % @ sequences which I think are coming from the ISOLINUX boot loader.
Here is the interesting part of the output that I get from Anaconda, in the form of Python strings:
'running install...\r\n'
'running /sbin/loader\r\n'
'\x1b%G'
'detecting hardware...\r\n'
and from CentOS startup:
'\x1b%G'
'\t\tWelcome to \x1b[0;36mCentOS\x1b[0;39m \r\r\n'
'Starting udev: '
Thanks for accepting pull request #38! Is there any more information you need for this one?
Is there any more information you need for this one?
Nope, no really. Thank you for making pyte
better :)
I'll merge the PR and update the comment you were uncertain about.
Thanks very much!
This commit adds handling in the Stream class for Linux escape sequences used to select either UTF-8 or default character sets.
Currently the commands generated when these sequences are detected are ignored, but it might make sense in the future to have ByteStream use these sequences to switch encodings.
(I want to handle Linux serial console output and just want the ESC % G sequences to be ignored, I'm already taking care of decoding myself. Please note the "FIXME" in the comment where I'm not sure what to say.)