Hey Martin,
Let me start by saying that this is not an answer to your problem, it's more of pointing you in a direction so that you can solve your problem.
With that said, if you look at this page:
FindFirst, you'll find that there are 2 overloads for the same function.
One uses a
UnicodeString and the other uses a
RawByteString. And both return a different type of
SearchRec.
Why can't I help you more? Well, that's because I've never dug deep into the magic that is the transformation the
type String gets involved in when it's passed around with
UnicodeString,
WideString,
UTF8String and all the others that I'm not aware of.
Because of that the issue could be anywhere since you're passing around a string with
UTF content, but some of the
LCL objects don't really know how to deal with that.
And good luck trying to identify what type of string it is. And how or where it gets mangled. And if you're planing on cross platform, if you get it running on Windows, then nothing guarantees you it will work on Linux due mainly to the OS, not the
FCL or
LCL.
So yeah, while it's a pain, and believe me, I'm Portuguese and we have to deal with the same issues, it's something that you'll have to dig around and see what type of string is being returned an then do stuff accordingly.
Unfortunately, you'll have to wait for the people that have more experience with
UTF containing strings, cuz I'm pretty crap at it myself, and for that I apologise profusely.
Cheers,
Gus