Recent

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

cazzajay

  • Jr. Member
  • **
  • Posts: 94
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)
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

eny

  • Hero Member
  • *****
  • Posts: 1648
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(...))
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

cazzajay

  • Jr. Member
  • **
  • Posts: 94
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?
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

 

TinyPortal © 2005-2018