Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Bad' characters from AS Studio text fields



 Many thanks Paul! Yes, that did the trick. 
 Question: Do I infer from your use of the handler that one can't directly coerce to text, e.g.,

    set txtByline to content of text field "txtByline" as text

  Thanks again to everyone,
       Jim


This may be one of those cases where you need true blue plain text, not
merely 'string'. Coercing Unicode to string results in 'international'
styled text, which may still be considered "bad characters". Try this
instead:

on AsPlainText(textual)
    
    (* Where 'textual' values may include plain text,'international text',
styled text, Pascal string, C string, Unicode text, and «class utf8».

    Unicode characters not having a single-byte "mapping" come back as a
question mark.
    *)
    
    set {text:plainText} to textual as text
    return plainText
    
end AsPlainText

Paul Berkowitz

-- 
email@hidden

__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.