Re: Applescript character conversion from PHP
Re: Applescript character conversion from PHP
- Subject: Re: Applescript character conversion from PHP
- From: Axel Luttgens <email@hidden>
- Date: Thu, 28 Nov 2002 15:18:28 +0100
Hans Schoenmaker wrote:
Hi Axel,
[snip]
That's for one part of your question ("why those different
behaviors ?").
The answer to that is, that line 2 is a copy/paste from an
email i send the guy from the PHP-server.
It's origine was MacRoman text.
This is what I suspected (the copy/paste).
Often got trapped that way ;-)
The 10th line is text from the database, so no MacRoman.
Could you have a look at the encodings used with the database?
The odds are great that only one charset is used, in which case your
problem would be greatly simplified.
Hope I managed to be clear...
Yes, you have been. But how you know the codes, it there a
table for it???
Character encoding is a highly normalized matter, so the hard but most
precise way is to read the normative docs.
Many computing/internet/xml/javascript... books propose character tables
in their appendixes.
A very fine tool is at:
http://www.eki.ee/letter/
You could also have a look at:
http://www.unicode.org
Finally, lots of people on this list have a deep knowledge on those matters.
Just to give an idea of what I mean:
Let's suppose your goal is to transmit a text file that may be
used as an AppleScript script to be executed as is (without
transformation) on the client.
Yes, that's the purpose of it.
So, the most basic way to do it would be to ensure that your
client receives a "MacRoman" encoded text.
This would mean that your PHP code is written to use such an
encoding (natively, PHP tends to use iso-8859-1 by default).
On the other hand, since you seem to work in an international
environment, a MacRoman character set may prove to be
insufficient. And you would perhaps have to resort using something
like UTF. What would have an impact on the AppleScript solution to
be implemented...
Well, i don't know anything about text encoding. Maybe you do?
Is there any info on that?
See above.
I was thinking of building a translation-script, but the
problem is i don't know what's what,
because as soon as i get the text file it's changed allready.
Unless the translation part could be performed on the server, so that
ready-to-use scripts become at hand on the client.
Thnx sofar and Greetings,
You're welcome ;-)
Now, if you allow, I'll restate your original question so that the
relationship with AppleScript becomes clearer, giving other people the
opportunity to help you with finding the better way to achieve what you
need.
The base idea is to produce text files on a server, such that they
could be downloaded and interpreted/executed as AppleScript scripts.
The files themselves would be downloaded (with URL Access Scripting)
and executed through a simple script.
Given the server's config, there should be no problem to achieve an
8-bit transfer (no spurious transforms).
The general form of the scripts to be transferred is:
property string1: "some text1"
...
property stringN: "some text N"
statements
At this moment, the server produces text under an iso-8859-1
encoding; this may of course be problematic as soon as the strings
constants contain characters outside of the ASCII range.
HTH,
Axel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.