mathiasbynens/dotfiles — Issue #36: Make `server` serve everything as UTF-8
Author: mathiasbynens
Created: 2012-01-04 15:12:01+00:00
State: open

By iterating over th `SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map` dict, appending `";charset=UTF-8"` to each item. Say, `dict((k, v+";charset=UTF-8") for k, v in SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map.iteritems())`.

Fun fact:

> If you’re actually writing Python 3, then you would use `{ k: v+";charset=UTF-8" for k, v in d.items() }` instead.