Fix the encoding issue - 'split': invalid byte sequence in UTF-8 (ArgumentError)