diff --git a/examples/sample.csv b/examples/sample.csv index 9821dcb18..b6e9bb260 100644 --- a/examples/sample.csv +++ b/examples/sample.csv @@ -1,3 +1,4 @@ "Date","Note","Amount" "2012/3/22","DEPOSIT","50.00" "2012/3/23","TRANSFER TO SAVINGS","-10.00" +"2012/3/24","COFFEE — €20 RECEIVED","-20.00" diff --git a/examples/sample.csv.cp1252.rules b/examples/sample.csv.cp1252.rules new file mode 100644 index 000000000..fd0998ed5 --- /dev/null +++ b/examples/sample.csv.cp1252.rules @@ -0,0 +1,2 @@ +include sample.csv.rules +encoding cp1252 diff --git a/examples/sample.csv.iso88591.rules b/examples/sample.csv.iso88591.rules new file mode 100644 index 000000000..a246922c1 --- /dev/null +++ b/examples/sample.csv.iso88591.rules @@ -0,0 +1,2 @@ +include sample.csv.rules +encoding iso8859-1 diff --git a/examples/sample.fr.cp1252.csv b/examples/sample.fr.cp1252.csv new file mode 100644 index 000000000..294956475 --- /dev/null +++ b/examples/sample.fr.cp1252.csv @@ -0,0 +1,4 @@ +"Date","Remarque","Montant" +"2012/3/22","DÉPÔT","50.00" +"2012/3/23","VIREMENT VERS ÉPARGNE","-10.00" +"2012/3/24","CAFÉ — €20 REÇU","-20.00" \ No newline at end of file diff --git a/examples/sample.fr.csv.py b/examples/sample.fr.csv.py new file mode 100644 index 000000000..cc1e000e3 --- /dev/null +++ b/examples/sample.fr.csv.py @@ -0,0 +1,16 @@ +text = '''"Date","Remarque","Montant" +"2012/3/22","DÉPÔT","50.00" +"2012/3/23","VIREMENT VERS ÉPARGNE","-10.00" +"2012/3/24","CAFÉ — €20 REÇU","-20.00"''' + +# Create UTF-8 file +with open('sample-fr.utf8.csv', 'wb') as f: + f.write(text.encode('utf-8')) + +# Create ISO-8859-1 file, replacing unsupported characters +with open('sample-fr.iso8859-1.csv', 'wb') as f: + f.write(text.encode('iso-8859-1', errors='replace')) + +# Create Windows-1252 file +with open('sample-fr.cp1252.csv', 'wb') as f: + f.write(text.encode('cp1252', errors='replace')) diff --git a/examples/sample.fr.iso88591.csv b/examples/sample.fr.iso88591.csv new file mode 100644 index 000000000..31aac77bf --- /dev/null +++ b/examples/sample.fr.iso88591.csv @@ -0,0 +1,4 @@ +"Date","Remarque","Montant" +"2012/3/22","DÉPÔT","50.00" +"2012/3/23","VIREMENT VERS ÉPARGNE","-10.00" +"2012/3/24","CAFÉ ? ?20 REÇU","-20.00" \ No newline at end of file diff --git a/examples/sample.fr.utf8.csv b/examples/sample.fr.utf8.csv new file mode 100644 index 000000000..705b8b265 --- /dev/null +++ b/examples/sample.fr.utf8.csv @@ -0,0 +1,4 @@ +"Date","Remarque","Montant" +"2012/3/22","DÉPÔT","50.00" +"2012/3/23","VIREMENT VERS ÉPARGNE","-10.00" +"2012/3/24","CAFÉ — €20 REÇU","-20.00" \ No newline at end of file