File: //usr/lib/python3/dist-packages/ocrmypdf/__pycache__/_unicodefun.cpython-38.pyc
U
��Z^h � @ s$ d dl Z d dlZd dlZdd� ZdS )� Nc C s� t jdd� dkrdS zddl} t�| �� �j}W n tk
rJ d}Y nX |dkrXdS d}tjdk�r�ddl }|j
dd g|j|jd
�j}t
� }d}t|t�r�|�dd�}|�� D ]4}|�� } | �� �d
�r�|�| � | �� dkr�d}q�|d7 }|s�|d7 }n&|�r|d7 }n|dd�t|�� 7 }d}tj�d�tj�d�fD ]0} | �r^| �� �d
��r^| }| dk �r@ �qr�q@|dk �r�|d| 7 }td| ��dS )z=Ensures that the environment is good for unicode on Python 3.r � )r � r N�ascii� �posix�localez-a)�stdout�stderrF�replace)z.utf-8z.utf8)zc.utf8zc.utf-8Tz
z�Additional information: on this system no suitable UTF-8
locales were discovered. This most likely requires resolving
by reconfiguring the locale system.z�This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8z�This system lists a couple of UTF-8 supporting locales that
you can pick from. The following suitable locales were
discovered: %sz, �LC_ALLZLANGz�
ocrmypdf discovered that you exported a UTF-8 locale
but the locale system could not pick up from it because
it does not exist. The exported locale is "%s" but it
is not supportedzsocrmypdf will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.)�sys�version_infor �codecs�lookup�getpreferredencoding�name� Exception�os�
subprocess�run�PIPEr �set�
isinstance�bytes�decode�
splitlines�strip�lower�endswith�add�join�sorted�environ�get�RuntimeError) r Zfs_encZextrar �rvZgood_localesZ
has_c_utf8�lineZ
bad_locale� r'