o
    ¨Êhþ  ã                   @   sb   d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ ejd  dkZ	dd„ Z
dd„ ZdS )	é    )Úprint_functionN)Ú	unidecodeé   c                 C   s   t j | d ¡ t  d¡ d S )NÚ
é   )ÚsysÚstderrÚwriteÚexit)Úmsg© r   ú@/var/www/html/env/lib/python3.10/site-packages/unidecode/util.pyÚfatal   s   r   c               
   C   sJ  t  ¡ } tjddd�}|jddd| d| f d� |jd	d
ddd� | ¡ \}}|j}|rP|jr4tdƒ nAt	|d dƒ�}| 
¡ }W d   ƒ n1 sJw   Y  n%|jrgtr\t |j¡}n|j}|d d¡7 }ntrptjj 
¡ }ntj 
¡ }z| |¡}W n tyš } ztd|j|j|jf ƒ W Y d }~nd }~ww tj t|ƒ¡ d S )Nz%prog [options] [FILE]z�Transliterate Unicode text into ASCII. FILE is path to file to transliterate. Standard input is used if FILE is omitted and -c is not specified.)Údescriptionz-ez
--encodingÚENCODINGz#Specify an encoding (default is %s))ÚmetavarÚdefaultÚhelpz-cÚTEXTÚtextz"Transliterate TEXT instead of FILE)r   Údestr   z!Can't use both FILE and -c optionr   Úrbr   Úasciiz.Unable to decode input: %s, start: %d, end: %d)ÚlocaleÚgetpreferredencodingÚoptparseÚOptionParserÚ
add_optionÚ
parse_argsÚencodingr   r   ÚopenÚreadÚPY3ÚosÚfsencodeÚencoder   ÚstdinÚbufferÚdecodeÚUnicodeDecodeErrorÚreasonÚstartÚendÚstdoutr	   r   )Údefault_encodingÚparserÚoptionsÚargsr   ÚfÚstreamÚer   r   r   Úmain   sD   ÿÿ
ÿ

ÿ€
$€ÿr5   )Ú
__future__r   r   r   r#   r   Úwarningsr   Úversion_infor"   r   r5   r   r   r   r   Ú<module>   s   