$ perl -CEO -MEncode=decode -MData::Peek -MText::CSV_XS -wE'my$c=Text::CSV_XS->new({sep_char=>"|",auto_diag=>1,binary=>1});while(<>){$c->parse(decode("utf-8",$_));DPeek for$c->fields}' test.csv PV("https://www.ibm.com/support/knowledgecenter/es/search/\357\277\275Cuales son las partes de una cadena de conexi\357\277\275n??s"...\0) [UTF8 "https://www.ibm.com/support/knowledgecenter/es/search/\x{fffd}Cuales son las partes de una cadena de conexi\x{fffd}n??scope=SSGU8G_12.1.0"] PV("https://www.ibm.com/support/knowledgecenter/es/SSGU8G_12.1.0/com.ibm.jdbc_pg.doc/ids_jdbc_011.htm"\0) PV("0"\0) PV("1"\0) PV("1"\0) PV("0"\0) PV("https://www.ibm.com/support/knowledgecenter/search/onsmsync?scope=SSGU8G_12.1.0"\0) PV("https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sec.doc/ids_lb_002.htm"\0) PV("1"\0) PV("1"\0) PV("1"\0) PV("1"\0)