1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 10:04:11 +01:00

Fix charset validation.

This commit is contained in:
Doug Kearns
2015-05-14 02:43:49 +10:00
parent 1c2766371b
commit a9a97704f3

View File

@@ -238,7 +238,13 @@ var IO = Module("io", {
},
validateCharset: function validateCharset(charset) {
new TextDecoder(charset);
try {
new TextDecoder(charset);
return true;
}
catch (e) {
return false;
}
},
// TODO: there seems to be no way, short of a new component, to change