ruby出現錯誤訊息:Incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
用force_encoding強迫指定編碼即可。for example,
sentence=row1[0].force_encoding('utf-8').gsub(reg,cor_array[count].force_encoding('utf-8')).strip
ruby出現錯誤訊息:Incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
用force_encoding強迫指定編碼即可。for example,
sentence=row1[0].force_encoding('utf-8').gsub(reg,cor_array[count].force_encoding('utf-8')).strip