Prevent to occur ArgumentError: invalid byte sequence in UTF-8