[Lazarus] file name encoding

Marc Santhoff M.Santhoff at web.de
Tue Dec 16 05:49:10 CET 2014


On Mo, 2014-12-15 at 21:14 +0100, Marco van de Voort wrote:
> On Sun, Dec 14, 2014 at 05:21:15PM +0100, Marc Santhoff wrote:
> > hopefully this is not too far OT i dare to ask:
> > 
> > When reading directories and files using FindFirst()/FindNext() using
> > system encoding my program hangs on german '?' (eszett).
> > 
> > I'm using fpc 2.6.2 and lazarus 1.2.0, so string encoding should
> > normally be the same as the system encoding. On the console nothing is
> > wrong, but in an xterm it fails.
> 
> I can't imagine why it would go wrong, findfirst/findnext in 2.6.x are afaik
> binary, without encoding conversion. 
> 
> Did you try to strace it ?

No, not yet. I wanted to avoid hours of strace or debugging sessions
with the chance of making a very dump known error. While waiting I
kicked out some other bugs in my code and today ... it can't be
reproduced.

When the error has been occuring it reproducably failed hanging in the
xterm on the char 'ß', verified by renaming the first file with that
char in the name and seeing the program hang on the second one. I had to
use CTRL-c to stop it. Other german chars, 'umlauts', where working fine
although being written to the xterm using a wrong char set.

The bugs fixed afterwards have no relation to encoding. One of them was
handing the wrong container to a deeper recursion level, but there are
no dangerous pointer handlings or similar involved. Only plain type
checked class instances, none of them got lost, only the wrong one was
filled with data. I have no idea what happened.

Sorry for the noise and thank you!

-- 
Marc Santhoff <M.Santhoff at web.de>





More information about the Lazarus mailing list