HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/breezy/__pycache__/cache_utf8.cpython-39.pyc
a

�*�^��@s�dZddlmZddlZejZejZefdd�ZiZ	iZ
e	e
efdd�Ze	e
efdd	�Zd
d�Z
dd
�Ze	e
fdd�Zdd�ZdS)zGSome functions to enable caching the conversion between unicode to utf8�)�absolute_importNcCs|durdS||�dSdS)z�wrap _utf8_decode to support None->None for optional strings.

    Also, only return the Unicode portion, since we don't care about the second
    return value.
    Nr�)Z
bytestring�_utf8_decoderr�3/usr/lib/python3/dist-packages/breezy/cache_utf8.py�_utf8_decode_with_NonesrcCsBz
||WSty<||�d||<}|||<|YS0dS)z8Take this unicode revision id, and get a unicode versionrN��KeyError)�unicode_str�_uni_to_utf8�_utf8_to_uni�_utf8_encode�utf8_strrrr�encode1s

rcCsBz
||WSty<||�d}|||<|||<|YS0dS)z<Take a utf8 revision id, and decode it, but cache the resultrNr)r
r
rrr	rrr�decodeFs
rcCstt|��S)z�Return a cached version of the unicode string.

    This has a similar idea to that of intern() in that it tries
    to return a singleton string. Only it works for unicode strings.
    )rr)r	rrr�get_cached_unicodeTs	rcCstt|��S)z�Return a cached version of the utf-8 string.

    Get a cached version of this string (similar to intern()).
    At present, this will be decoded to ensure it is a utf-8 string. In the
    future this might change to simply caching the string.
    )rr)r
rrr�get_cached_utf8`srcCs&|�d�}|�||�}|�||�|S)z9This is a string which is identical in utf-8 and unicode.�ascii)r�
setdefault)Z	ascii_strr
rZuni_strrrr�get_cached_asciijs
rcCst��t��dS)z&Clear the encoding and decoding cachesN)�_unicode_to_utf8_map�clear�_utf8_to_unicode_maprrrr�clear_encoding_cachexsr)�__doc__Z
__future__r�codecs�utf_8_encoder�utf_8_decoderrrrrrrrrrrrrr�<module>s*�
�
�