0

I use AppleScript's script editor. When I try to display \u... formatted characters in a dialog box as readable text, I don't succeed. What's the problem?

Here's what I tried:

set theTextItems to (do shell script "printf \"\\u82f9\\u679c\"")
display dialog theTextItems as text

The output of the dialog box that pops up is:

\u82f9\u679c
Shine
  • 47
  • 7

1 Answers1

1

It sounds like OP is trying to parse JSON-encoded data using plain AppleScript. Don’t. Use JSON Helper app (available in AppStore) or NSJSONSerialization via the AppleScript-ObjC bridge. Those will process any character escapes for you.

foo
  • 166
  • 1
  • 3