take care of right encoding

ref to https://github.com/Codiad/Codiad/issues/305