B s `÷ã@södZddlZddlZiZded<ded<ded<d ed <d ed <d ed<dd„eddƒDƒZxe ¡D]\ZZeee<qfWdd„eddƒDƒdd„eddƒDƒdd„eddƒDƒZ xe ¡D]\ZZee e<qÀW[[dd„Z e  d¡Z dd„Z dS)zEncoding related utilities.éNz\té z\né z\ré z\"é"z\'é'z\\é\cCsg|] }t|ƒ‘qS©)Úchr)Ú.0ÚirrúA/tmp/pip-unpacked-wheel-u0__x60w/google/protobuf/text_encoding.pyú -sr écCsg|] }d|‘qS)z\%03or)r r rrr r 2sé cCsg|] }t|ƒ‘qSr)r )r r rrr r 3sécCsg|] }d|‘qS)z\%03or)r r rrr r 4scsltjr4t|tƒ}|r"|r"| t¡S|r*tndd„‰nt‰|rTd ‡fdd„|Dƒ¡Sd ‡fdd„|Dƒ¡S)amEscape a bytes string for use in an text protocol buffer. Args: text: A byte string to be escaped. as_utf8: Specifies if result may contain non-ASCII characters. In Python 3 this allows unescaped non-ASCII Unicode characters. In Python 2 the return value will be valid UTF-8 rather than only ASCII. Returns: Escaped string (str). cSs|S)Nr)Úxrrr ÚPózCEscape..Úc3s|]}tˆ|ƒVqdS)N)Ú_cescape_unicode_to_str)r Úc)Úord_rr ú TszCEscape..c3s|]}tˆ|ƒVqdS)N)Ú_cescape_byte_to_str)r r)rrr rUs)ÚsixÚPY3Ú isinstanceÚstrÚ translateÚ_cescape_chr_to_symbol_mapÚordÚjoin)ÚtextZas_utf8Ztext_is_unicoder)rr ÚCEscape:s  r#z"(\\+)x([0-9a-fA-F])(?![0-9a-fA-F])cCs:dd„}t ||¡}tjr$| d¡S| d¡ d¡ d¡S)z”Unescape a text string with C-style escape sequences to UTF-8 bytes. Args: text: The data to parse in a str. Returns: A byte string. cSs4t| d¡ƒd@r*| d¡d| d¡S| d¡S)NéZx0ér)ÚlenÚgroup)Úmrrr Ú ReplaceHexeszCUnescape..ReplaceHexZ string_escapezutf-8Zunicode_escapeZraw_unicode_escape)Ú_CUNESCAPE_HEXÚsubrÚPY2ÚdecodeÚencode)r"r)Úresultrrr Ú CUnescape[s    r0)Ú__doc__ÚrerrÚrangerÚitemsÚbyteÚstringrr#Úcompiler*r0rrrr Ús( &