Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1045

encoding as windows-1252 and decoding as UTF-8

$
0
0

recently I've stumbled upon this old python code:

for key, value in values.items():    item = value    try:        if type(item) is str:            item = item.encode('windows-1252')            item = item.decode('utf8')    except BaseException:        item = value    finally:        parsed_values[key] = itemreturn parsed_values

Is there a valid reason to do such encoding conversion? Isnt utf8 going to not show some of windows-1252 characters if they are present?


Viewing all articles
Browse latest Browse all 1045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>