Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-03

RTL: file system functions results encoding

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vladimir

Hi,

Working with SysUtils.FindFirst and FindNext routines I found that the encoding of resulting TSearchRec record fields differs across platforms. Under Windows it seems to be ANSI and under Linux it seems to be UTF-8. The problem is that application expects the same encoding everywhere. Is there any way to determine the resulting encoding to convert fields to the encoding I need?

Reply by email

Michael Van Canneyt
to Vladimir
Vladimir wrote 8 lines
Hi, Working with SysUtils.FindFirst and FindNext routines I found that the encoding of resulting TSearchRec record fields differs across platforms. Under Windows it seems to be ANSI and under Linux it seems to be UTF-8. The problem is that application expects the same encoding everywhere. Is there any way to determine the resulting encoding to convert fields to the encoding I need?

In short: no. But you shouldn't have to ?
The result depends on the system calls used by the FindFirst/FindNext calls, and since the system calls are by definition system dependent, so you know on which platform what encoding is used.

Michael.

Reply by email

Unknown author
to Michael Van Canneyt
Michael Van Canneyt wrote 15 lines
On Mon, 10 Mar 2008, Vladimir wrote: > Hi, > > Working with SysUtils.FindFirst and FindNext routines I found that the encoding > of resulting TSearchRec record fields differs across platforms. > Under Windows it seems to be ANSI and under Linux it seems to be UTF-8. > The problem is that application expects the same encoding everywhere. > Is there any way to determine the resulting encoding to convert fields > to the encoding I need? In short: no. But you shouldn't have to ? The result depends on the system calls used by the FindFirst/FindNext calls, and since the system calls are by definition system dependent, so you know on which platform what encoding is used.

Thanks, Michael. I'll try to implement some abstraction layer then.

Reply by email