Author Topic: CSV Import UTF8 issue  (Read 3546 times)

tf67

  • Newbie
  • *
  • Posts: 3
CSV Import UTF8 issue
« 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

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1514
  • Archi Guy
    • Archi
Re: CSV Import UTF8 issue
« Reply #1 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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

tf67

  • Newbie
  • *
  • Posts: 3
Re: CSV Import UTF8 issue
« Reply #2 on: January 13, 2015, 11:54:05 AM »
Hi Phil,

thanks for looking into this. Please see attached a sample file.

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1514
  • Archi Guy
    • Archi
Re: CSV Import UTF8 issue
« Reply #3 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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

tf67

  • Newbie
  • *
  • Posts: 3
Re: CSV Import UTF8 issue
« Reply #4 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.