robot.utils.encoding
¶
console_decode
¶
Decodes bytes from console encoding to Unicode.
Uses the system console encoding by default, but that can be configured
using the encoding argument. In addition to the normal encodings,
it is possible to use case-insensitive values CONSOLE and SYSTEM to
use the system console and system encoding, respectively.
If string is already Unicode, it is returned as-is.
Source code in src/robot/utils/encoding.py
console_encode
¶
|
Encodes the given string so that it can be used in the console.
If encoding is not given, determines it based on the given stream and system
configuration. In addition to the normal encodings, it is possible to use
case-insensitive values CONSOLE and SYSTEM to use the system console
and system encoding, respectively.
Decodes bytes back to Unicode by default, because Python 3 APIs in general
work with strings. Use force=True if that is not desired.