Hi all!
I've a problem and I have not ideas how to solve it - I've googled, read apple guides - but no luck.I've a fpc/lazarus app (intel). This app is launched from another app.
When I'm running it from terminal (applescript: "
do shell script "open PathToMyApp"") or Finder - it runs well. But when I'm running it from a AppleScript script (
do shell script PathToMyApp) it can't read/write uft8 inifile. Let me explain what I mean when I said "it can't" - I've some language ini files in the app folder. Let it be "german.ini". This files are UTF8 encoded.
And I'm reading a language file in following way:
var s : WideString;
s :=DecodeUTF8String(ini.ReadString(...));
write_widestring_to_anotherfile(s);.
When app is launched from Terminal (or using "open" command) it writes string ok, but when it's launched from applescript without "open" command - it shows only "?" when special characters are present. As another site said (
http://forum.soft32.com/mac/Recipes-shell-script-commands-applescript-ftopict38741.html_- The reason is because Terminal uses the Tsch shell (an enhanced C
shell), and the applescript "do shell script " function uses the
Bourne shell. Slightly different commands and syntax are needed for
each shell.But I can't figure out why app when lauched from "sh" it can't decode utf8 to widestring correctly.
It's a some sort of mystery?

Anybody has similar problem?
p.s. sorry for my English, I know it's not good
