~e!ddlmZdZdZy))unicodecHt|tr|jd}|S)z> A small helper to decode unicode to utf-8 if needed. utf-8) isinstancerencode)values 8/usr/lib/python3/dist-packages/landscape/lib/encoding.pyencode_if_neededr s!%! W% Lc|j}|jD]+\}}t|ts|j dd||<-|S)zR Encode values of the given C{dictionary} with utf-8 and surrogateescape. rsurrogateescape)copyitemsrrr) dictionary_dictkeyvals r encode_valuesr sQ OO EKKM@S c7 #G->?E#J@ Lr N)twisted.python.compatrr rr r rs)r