* * *

Author Topic: copyfile routine containing apostrophes  (Read 4687 times)

cazzajay

  • Jr. Member
  • **
  • Posts: 83
Re: copyfile routine containing apostrophes
« Reply #15 on: May 11, 2011, 03:44:37 pm »
having played about a bit more - a dirty solution to this is to use FileSize and say if > 0 then it exists. that seems to work (just in case someone else has the same problem in future and searches the forum)

eny

  • Hero Member
  • *****
  • Posts: 812
Re: copyfile routine containing apostrophes
« Reply #16 on: May 11, 2011, 04:20:48 pm »
hmm - just noticed that FileExists does not work with these accented chars, or apostrophes, too

All works perfectly well; you just shouldn't mix ansi and utf8 character sets.
If you use special characters (like ö) you should use either
  FileExistsUTF8(...)
or
  FileExists(UTF8toAnsi(...))
WinXP Prof SP3; Lazarus 0.9.30; FPC 2.4.4; 2011-06-02 (#29749)

cazzajay

  • Jr. Member
  • **
  • Posts: 83
Re: copyfile routine containing apostrophes
« Reply #17 on: May 11, 2011, 05:02:32 pm »
hmm - just noticed that FileExists does not work with these accented chars, or apostrophes, too

All works perfectly well; you just shouldn't mix ansi and utf8 character sets.
If you use special characters (like ö) you should use either
  FileExistsUTF8(...)
or
  FileExists(UTF8toAnsi(...))


sweet. out of curiosity, does UTF8toAnsi convert the characters to their "nearest equivalent" i.e.: ö -> o ??
and what does it do to chars that dont have an obvious equivalent?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads