Converts the given string, bytes, or object to a text string. Args: data: Any bytes, string, or object that has str() or unicode() methods. encoding: A suggesting encoding used to decode. If this encoding doesn't work, other defaults are tried. Defaults to GetConsoleAttr().Get
(data, encoding=None)
| 796 | |
| 797 | |
| 798 | def Decode(data, encoding=None): |
| 799 | """Converts the given string, bytes, or object to a text string. |
| 800 | |
| 801 | Args: |
| 802 | data: Any bytes, string, or object that has str() or unicode() methods. |
| 803 | encoding: A suggesting encoding used to decode. If this encoding doesn't |
| 804 | work, other defaults are tried. Defaults to |
| 805 | GetConsoleAttr().GetEncoding(). |
| 806 | |
| 807 | Returns: |
| 808 | A text string representation of the data. |
| 809 | """ |
| 810 | encoding = encoding or GetConsoleAttr().GetEncoding() |
| 811 | return encoding_util.Decode(data, encoding=encoding) |
nothing calls this directly
no test coverage detected