o ¶žâc!ã@s ddlmZdd„Zdd„ZdS)é)ÚunicodecCst|tƒr | d¡}|S)z> A small helper to decode unicode to utf-8 if needed. úutf-8)Ú isinstancerÚencode)Úvalue©rú8/usr/lib/python3/dist-packages/landscape/lib/encoding.pyÚencode_if_neededs  r cCs8| ¡}| ¡D]\}}t|tƒr| dd¡||<q|S)zR Encode values of the given C{dictionary} with utf-8 and surrogateescape. rÚsurrogateescape)ÚcopyÚitemsrrr)Ú dictionaryÚ_dictÚkeyÚvalrrrÚ encode_values s  €rN)Útwisted.python.compatrr rrrrrÚs