On Thu, 30 May 2013 20:44:25 +0200 Bart <[email protected]> wrote:
> Hi, > > I'm a bit confused here. > I have a TSynEdit. > If I do SynEdit1.Lines.LoadFromFile(OpenDialog1.FileName) this > succeeds on filenames with unicode characters within the current > codepage. > No need to use Utf8ToSys like it is necessary for TMemo.Lines.LoadFromFile. > > AFAICS the lines property of a TSynEdit is of type TStrings, just like > the Lines of TMemo. Yes, but it is a TSynEditLines, which overloads LoadFromFile and does UTF8ToSys itself. It should be changed to use the UTF8 file functions instead. > Even while I don't understand this, I can live with it. > TSynEdit needs no Utf8ToSys for loading, OK. > > But wait, if a filename has unicode characters outside the current > codepage (I have a folder with some asian charcters in the name), this > fails al of the sudden. Yes. > So, now I need to know the why, or else I cannot fix it. Change syneditlines.pas TFileStream to TFileStreamUTF8. I don't have Windows here, so I can not test. > B.t.w. the Lazarus IDE is able to this file, and so is a > TStringListUtf8 instance. Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
