Blocklist encode 686004

Fixed the non ascii chars error and added tests.
Refers to https://bugzilla.mozilla.org/show_bug.cgi?id=686004