Archi Forum

Archi => Archi Development => Topic started by: tf67 on January 13, 2015, 11:02:50 AM

Title: CSV Import UTF8 issue
Post by: tf67 on January 13, 2015, 11:02:50 AM
Hi All,
I had some trouble to use the csv import functionality receiving an error message saying 'Type shoulde be of ArchiMate element type'. I traced back the problem to the file encoding being UTF8, converting it into ANSI resolved the issue.

I think it would be helpful to include a note to the user guide that the file must be in ANSI format
and I would appreciate to see csv UTF8 support in the next release.

Thanks,
Tom
Title: Re: CSV Import UTF8 issue
Post by: Phil Beauvoir on January 13, 2015, 11:10:21 AM
Hi,

that doesn't sound right. "Type should be of ArchiMate element type'" is an error that occurs if a referenced element is not an ArchiMate concept. ANSI/UTF-8 should not affect it. Unless something gets mangled. Do you have a simple example to reproduce the error?

Phil
Title: Re: CSV Import UTF8 issue
Post by: tf67 on January 13, 2015, 11:54:05 AM
Hi Phil,

thanks for looking into this. Please see attached a sample file.
Title: Re: CSV Import UTF8 issue
Post by: Phil Beauvoir on January 13, 2015, 12:21:15 PM
Thanks for the attached file. I get the same error. But the error message is not the real issue.

Your file is UTF-8, but it is UTF-8 with BOM type. The CSV parser library that Archi uses (http://commons.apache.org/proper/commons-csv/) reads in the first line but for some reason does not remove quote marks from the first field:

"ID",TYPE,NAME,DOCUMENTATION

And so parsing fails.

I'm not sure if I can work around this. In the mean time, save CSV files as UTF-8, but not UTF-8 with BOM.

Phil
Title: Re: CSV Import UTF8 issue
Post by: tf67 on January 13, 2015, 14:13:26 PM
Thanks Phil for the quick reply.

In the meantime I tested UTF-16 (UCS-2) Little Endian & UTF-16 (UCS-2) Big Endian which are also causing errors although different.

All in all, I think it is not a big issue and I agree in must cases ANSI is absolutely fine.