fix for handling data urls with charsets, e.g., data:text/html;charset=utf-8;base64,...
properly decode unicode charsets
Currently, when viewing data urls with charsets, the app crashes because the header isn't stripped and base64 decoding (window.atob) throws an error due to invalid base64 chars. This uses a regex for stripping the header with any charset, but also extracts the charset and uses TextDecoder to convert the binary string into a unicode string before being written to the iframe (if necessary).
Currently, when viewing data urls with charsets, the app crashes because the header isn't stripped and base64 decoding (window.atob) throws an error due to invalid base64 chars. This uses a regex for stripping the header with any charset, but also extracts the charset and uses TextDecoder to convert the binary string into a unicode string before being written to the iframe (if necessary).