%PDF- %PDF-
Direktori : /snap/core20/2582/lib/python3/dist-packages/urwid/__pycache__/ |
Current File : //snap/core20/2582/lib/python3/dist-packages/urwid/__pycache__/util.cpython-38.pyc |
U ��dZ�3 � @ sd d dl mZmZ d dlmZ d dlmZmZmZ d dl Z ej Z e jZe jZe j Z e jZe jZe jZdd� Zde� kr|e� Znd s�td��dad ad d� Zdd � Zdd� Zee� dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Z dd� Z!d d!� Z"d"d#� Z#d$d%� Z$G d&d'� d'e%�Z&d(d)� Z'd*d+� Z(d,d-� Z)d.d/� Z*G d0d1� d1e+�Z,d2d3� Z-G d4d5� d5e.�Z/dS )6� )�division�print_function)�escape)�bytes� text_type� text_typesNc C s� dd l } z<z| �| jd� W n | jk r2 Y nX | �� d pBdW S tk r� } z&|jrv|jd �d�rvW Y � dS � W 5 d }~X Y nX d S )Nr � � zunknown locale)�locale� setlocale�LC_ALL�ErrorZ getlocale� ValueError�args� startswith)r �e� r �,/usr/lib/python3/dist-packages/urwid/util.py�detect_encoding) s r �detected_encodingz It worked!Tc C sz | � � } | dkr t�d� dan&| dkr8t�d� dant�d� dadaz| r^d �| � | aW n tk rt Y nX d S )z~ Set the byte encoding to assume when processing strings and the encoding to use when converting unicode strings. )zutf-8�utf8�utfr F)zeuc-jpzeuc-krzeuc-cnzeuc-tw�gb2312�gbk�big5zcn-gb�uhc�eucjp�euckr�euccnZeuctwZcncbZwideTZnarrow�asciir N)�lower�str_utilZset_byte_encoding�_use_dec_special�_target_encoding�encode�LookupError)�encodingr r r �set_encodingB s r'