• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ignoring Smart Quotes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ignoring Smart Quotes


  • Subject: Re: Ignoring Smart Quotes
  • From: KOENIG Yvan <email@hidden>
  • Date: Thu, 2 Oct 2008 17:42:56 +0200


Le 2 oct. 2008 à 17:32, Simon Topliss a écrit :

Hi,

I was hoping that 'ingoring…" something would let me evaluate text that contains smart quotes against regular hyphens would let me test to equality of a Unicode text string.

However, this code evaluates to false.

set t1 to "Apple's" -- regular hyphen (ASCII #39 Unicode 0027)
set t2 to "Apple’s" -- U+2019 (8217)

ignoring punctuation and diacriticals
	t1 = t2
end ignoring

Does anyone have any code snippets that would help or recommend another approach.


set T1 to "Apple's" -- regular hyphen (ASCII #39 Unicode 0027) set T2 to "Apple’s" -- U+2019 (8217)

my chercheRemplace(T1, "’", "'") = my chercheRemplace(T2, "’", "'") (* smart quote, straight quote *)

on chercheRemplace(t, tid1, tid2)
	local l
	set AppleScript's text item delimiters to tid1
	set l to text items of t
	set AppleScript's text item delimiters to tid2
	set t to l as text
	set AppleScript's text item delimiters to ""
	return t
end chercheRemplace

Yvan KOENIG (from FRANCE jeudi 2 octobre 2008 17:42:15)


_______________________________________________ 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
References: 
 >Ignoring Smart Quotes (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: AppleScript broken in 10.5.4
  • Next by Date: Re: AppleScript broken in 10.5.4
  • Previous by thread: Ignoring Smart Quotes
  • Next by thread: Re: Ignoring Smart Quotes
  • Index(es):
    • Date
    • Thread