Robot Framework Integrated Development Environment (RIDE)
robotide.lib.robot.utils.encoding Namespace Reference

Functions

def _get_console_encoding (stream)
 
def console_decode (string, encoding=CONSOLE_ENCODING, force=False)
 Decodes bytes from console encoding to Unicode. More...
 
def console_encode (string, errors='replace', stream=sys.__stdout__)
 Encodes Unicode to bytes in console or system encoding. More...
 
def system_decode (string)
 Decodes bytes from system (e.g. More...
 
def system_encode (string, errors='replace')
 Encodes Unicode to system encoding (e.g. More...
 

Variables

 CONSOLE_ENCODING = get_console_encoding()
 
 NON_TTY_ENCODING_CAN_BE_TRUSTED = \
 
 SYSTEM_ENCODING = get_system_encoding()
 

Function Documentation

◆ _get_console_encoding()

def robotide.lib.robot.utils.encoding._get_console_encoding (   stream)
private

Definition at line 71 of file encoding.py.

◆ console_decode()

def robotide.lib.robot.utils.encoding.console_decode (   string,
  encoding = CONSOLE_ENCODING,
  force = False 
)

Decodes bytes from console encoding to Unicode.

By default uses the system console encoding, 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.

By default returns Unicode strings as-is. The `force` argument can be used
on IronPython where all strings are `unicode` and caller knows decoding
is needed.

Definition at line 45 of file encoding.py.

◆ console_encode()

def robotide.lib.robot.utils.encoding.console_encode (   string,
  errors = 'replace',
  stream = sys.__stdout__ 
)

Encodes Unicode to bytes in console or system encoding.

Determines the encoding to use based on the given stream and system
configuration. On Python 3 and IronPython returns Unicode, otherwise
returns bytes.

Definition at line 62 of file encoding.py.

◆ system_decode()

def robotide.lib.robot.utils.encoding.system_decode ( string  )

Decodes bytes from system (e.g.

cli args or env vars) to Unicode.

Definition at line 81 of file encoding.py.

◆ system_encode()

def robotide.lib.robot.utils.encoding.system_encode ( string  ,
errors  = 'replace' 
)

Encodes Unicode to system encoding (e.g.

cli args and env vars).

    Non-Unicode values are first converted to Unicode.

Definition at line 84 of file encoding.py.

Variable Documentation

◆ CONSOLE_ENCODING

robotide.lib.robot.utils.encoding.CONSOLE_ENCODING = get_console_encoding()

Definition at line 26 of file encoding.py.

◆ NON_TTY_ENCODING_CAN_BE_TRUSTED

robotide.lib.robot.utils.encoding.NON_TTY_ENCODING_CAN_BE_TRUSTED = \

Definition at line 30 of file encoding.py.

◆ SYSTEM_ENCODING

robotide.lib.robot.utils.encoding.SYSTEM_ENCODING = get_system_encoding()

Definition at line 27 of file encoding.py.