Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

the validate function returns false for utf-16le encoded feeds #4

Open
eRGoon opened this issue Aug 2, 2013 · 0 comments
Open

the validate function returns false for utf-16le encoded feeds #4

eRGoon opened this issue Aug 2, 2013 · 0 comments

Comments

@eRGoon
Copy link

eRGoon commented Aug 2, 2013

I just convert all utf-16le encoded feeds to utf-8

if (enc && enc.toLowerCase() === "utf-16le") {
    var chars = [];

    for (var i = 0, l = body.length; i < l; i += 2) {
        chars.push(body.charCodeAt(i) | (body.charCodeAt(i + 1) << 8));
    }

    body = String.fromCharCode.apply(String, chars);
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant