Part of bzrlib
Function | encode | Take this unicode revision id, and get a unicode version |
Function | decode | Take a utf8 revision id, and decode it, but cache the result |
Function | get_cached_unicode | Return a cached version of the unicode string. |
Function | get_cached_utf8 | Return a cached version of the utf-8 string. |
Function | get_cached_ascii | This is a string which is identical in utf-8 and unicode. |
Function | clear_encoding_cache | Clear the encoding and decoding caches |
Function | _utf8_decode_with_None | 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.
This has a similar idea to that of intern() in that it tries to return a singleton string. Only it works for unicode strings.
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.