Don
Don

Reputation: 163

How to properly handle character encoding when reading a file in Karate

Character Ñ is being converted to � when reading a csv file.

* def data = read("data.csv")
* print data

expected:
VALUE1,VALUE2,DASMARIÑAS CITY

actual:
VALUE1,VALUE2,DASMARI�AS CITY

Upvotes: 1

Views: 504

Answers (1)

Don
Don

Reputation: 163

Resolved by just saving the csv file with type CSV UTF-8 (Comma delimited) (*csv) enter image description here

Though previously working filter using karate.jsonPath is now not working

* def filteredData = karate.jsonPath(read("data.csv"),'$[?(@.TC_ID=="'+TC_ID+'")]')

Upvotes: 1

Related Questions