CsvDataSet - Character ... cannot be handled

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CsvDataSet - Character ... cannot be handled

tsriba
Hi,

I would like to load CSV files. During loading file I got the following error for the input data:

1/ Input data

nazev;jmeno;prijmeni
test;test1;K\ho

2/ Error message

Caused by: org.dbunit.dataset.DataSetException: org.dbunit.dataset.common.handlers.IllegalInputCharacterException: (working on piece #0)test;test1;K: Character 'h' cannot be handled
    at org.dbunit.dataset.csv.CsvProducer.produceFromFile(CsvProducer.java:135)
    at org.dbunit.dataset.csv.CsvProducer.produce(CsvProducer.java:93)
    ... 4 more
Caused by: org.dbunit.dataset.common.handlers.IllegalInputCharacterException: (working on piece #0)test;test1;K: Character 'h' cannot be handled
    at org.dbunit.dataset.common.handlers.EnforceHandler.canHandle(EnforceHandler.java:70)
    at org.dbunit.dataset.common.handlers.AbstractPipelineComponent.handle(AbstractPipelineComponent.java:80)
    at org.dbunit.dataset.common.handlers.Pipeline.handle(Pipeline.java:166)
    at org.dbunit.dataset.csv.CsvParserImpl.parse(CsvParserImpl.java:87)
    at org.dbunit.dataset.csv.CsvParserImpl.collectExpectedNumberOfColumns(CsvParserImpl.java:179)
    at org.dbunit.dataset.csv.CsvParserImpl.parseTheData(CsvParserImpl.java:159)
    at org.dbunit.dataset.csv.CsvParserImpl.parse(CsvParserImpl.java:124)
    at org.dbunit.dataset.csv.CsvParserImpl.parse(CsvParserImpl.java:99)
    at org.dbunit.dataset.csv.CsvProducer.produceFromFile(CsvProducer.java:112)
    ... 5 more

3/ The code

        try {
            IDataSet expectedDataSeta = new CsvDataSet(new File("D:\\tmp"));
        } catch (DataSetException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

Any idea for this Character 'h' cannot be handled? I tried without '\' and it's working.

Thx.

Tomas

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user