[REQ] Strange char "?" in html source from Safari
[REQ] Strange char "?" in html source from Safari
- Subject: [REQ] Strange char "?" in html source from Safari
- From: Marco Trotta <email@hidden>
- Date: Wed, 25 Jul 2007 10:41:45 +0200
Hi,
i'm an applescript user. i'm having a trouble with html source from
safari
i've wrote a script in order to identify and copy text from html
source.
but there is a trouble with source coming from this kind of site:
http://www.lastampa.it/redazione/cmsSezioni/economia/200707articoli/24000girata.asp
When i try to get text from html, the "'" become "?"
Example
tell application "Safari" to copy (source of front document) to testo
set dadove to (matchPos of (find text "<div class='articologirata'>" in
testo)) + 29
set findove to matchPos of (find text "</div>" in testo starting at dadove)
set body to (extract string testo from dadove to findove)
If i'm try this
tell application "Safari" to copy (source of front document) to testo
set x to (offset of "accordo di fusione" in testo) - 1
-- look in html rendering "l'accordo di fusione"
get character x of testo
the result is "í"
but if If i'm try this
tell application "Safari" to copy (source of front document) to testo
set x to (offset of "accordo di fusione" in testo) - 1
-- look in html rendering "l'accordo di fusione"
get ASCII number (character x of testo)
the result is "63", the ascii decimal number fo "?"
I think is a trouble of windows char coding. but i do not know how
solve it.
i'm using mac os 10.3.9
could you help me?
thanks. mt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden