<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi, <br>
</p>
<p>I investigate a bit the situation, and the problem seems to come
from identity comparison of character which could be instance of
Character or instance of UnicodeCodePoint when read from file. So
we have identity comparison:</p>
<p>peekSeparator<br>
^ self peekChar == separator</p>
<p>There is other method in NeoCSV relying on equal identity between
characters: #peekFor: #peekQuote <br>
</p>
<p>Options to fix it:</p>
<ul>
<li>Make the separator a UnicodePoint, most tests should break. </li>
<li>Use equality instead of identity => tested, lock the image<br>
</li>
<li>other... <br>
</li>
</ul>
<p>I added a test to detect that scenario.</p>
<p><br>
</p>
<p><br>
</p>
<p>Hilaire<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 22/07/2023 à 23:58, Hilaire
Fernandes via Cuis-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:b35774b3-be0b-b6c1-6ae9-018aab946e71@free.fr">Hi, <br>
<br>
In the first scenario bellow, the csv content is read correctly,
the header is the expect array with 3 items. <br>
<br>
In the second scenario, where the same content is read from the
timeSlot.csv file, the header is not correctly interpreted, indeed
an array with only one string is returned. <br>
<br>
It is like if the comma is not interpreted as a field separator. <br>
<br>
In the first scenario the data is a String, in the second the file
content is instantiated as an UnicodeString. <br>
<br>
To reproduce, install NeoCSV package from my forked repository <br>
<br>
( NeoCSVReader on: 'timeSlotName,start,end <br>
P1,7:45,8:30 <br>
P2,8:35,9:20' readStream) readHeader. <br>
<br>
=> #('timeSlotName' 'start' 'end') . <br>
<br>
<br>
( NeoCSVReader on: 'timeSlot.csv' asFileEntry readStream)
readHeader. <br>
<br>
=> #('timeSlotName,start,end') . <br>
<br>
Thanks <br>
<br>
Hilaire <br>
<br>
</blockquote>
</body>
</html>