def encoded_dict(in_dict):
out_dict = {}<EOL>for k, v in in_dict.items():<EOL><INDENT>if isinstance(v, unicode):<EOL><INDENT>if sys.version_info < (<NUM_LIT:3>, <NUM_LIT:0>):<EOL><INDENT>v = v.encode('<STR_LIT:utf8>')<EOL><DEDENT><DEDENT>elif isinstance(v, str):<EOL><INDENT>if sys.version_info < (<NUM_LIT:3>, <NUM_LIT:0>):<EOL><INDENT>v.decode('<STR_LIT:utf8>')<EOL><DEDENT><DEDENT>out_dict[k] = v<EOL><DEDENT>return out_dict<EOL>
Encode every value of a dict to UTF-8.

    Useful for POSTing requests on the 'data' parameter of urlencode.