U Xzf_÷ã@sîdZddlZddlZiZded<ded<ded<d ed <d ed <d ed<dd„eddƒDƒZe ¡D]\ZZeee<qddd„eddƒDƒdd„eddƒDƒdd„eddƒDƒZ e ¡D]\ZZee e<qº[[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úu/private/var/folders/n9/53xbvtmd7sjg1q1l55xmpg58n4mgng/T/pip-unpacked-wheel-3cr5c46n/google/protobuf/text_encoding.pyÚ -srécCsg|] }d|‘qS©z\%03orr rrrr2sé cCsg|] }t|ƒ‘qSrr r rrrr3sécCsg|] }d|‘qSrrr rrrr4scsltjr4t|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ˆ|ƒVqdSr)Ú_cescape_unicode_to_str©r Úc©Zord_rrÚ TszCEscape..c3s|]}tˆ|ƒVqdSr)Ú_cescape_byte_to_strrrrrrUs)ÚsixÚPY3Ú isinstanceÚstrÚ translateÚ_cescape_chr_to_symbol_mapÚordÚjoin)ÚtextZas_utf8Ztext_is_unicoderrrÚ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    ÿýr5)Ú__doc__Úrerr$ÚrangerÚitemsÚbyteÚstringrr(Úcompiler/r5rrrrÚs. ÿþ