diff options
author | hobbs <hobbs@noemail.net> | 1999-12-21 23:58:13 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 1999-12-21 23:58:13 (GMT) |
commit | e83b3d7b1b65fc19ce1da261ec638dbc844425e2 (patch) | |
tree | 76f8a45f28b841f127ee825da3183acee50b31bb /mac/tclMacOSA.c | |
parent | d8e2341c2b480ff76023802fd81f06fdec37f2c0 (diff) | |
download | tcl-e83b3d7b1b65fc19ce1da261ec638dbc844425e2.zip tcl-e83b3d7b1b65fc19ce1da261ec638dbc844425e2.tar.gz tcl-e83b3d7b1b65fc19ce1da261ec638dbc844425e2.tar.bz2 |
* mac/tclMacOSA.c: fixed applescript for I18N [Bug: 3644]
FossilOrigin-Name: 9b8241d4cdcaa44d61409aaf90108edcec79b79b
Diffstat (limited to 'mac/tclMacOSA.c')
-rw-r--r-- | mac/tclMacOSA.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/mac/tclMacOSA.c b/mac/tclMacOSA.c index 72dcccf..5036a8e 100644 --- a/mac/tclMacOSA.c +++ b/mac/tclMacOSA.c @@ -12,7 +12,7 @@ * See the file "License Terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSA.c,v 1.5 1999/08/15 04:04:06 jingham Exp $ + * RCS: @(#) $Id: tclMacOSA.c,v 1.6 1999/12/21 23:58:13 hobbs Exp $ */ #define MAC_TCL @@ -2695,9 +2695,10 @@ prepareScriptData( int i; char buffer[7]; OSErr sysErr = noErr; - + Tcl_DString encodedText; + Tcl_DStringInit(scrptData); - + for (i = 0; i < argc; i++) { Tcl_DStringAppend(scrptData, argv[i], -1); Tcl_DStringAppend(scrptData, " ", 1); @@ -2707,7 +2708,7 @@ prepareScriptData( * First replace the \n's with \r's in the script argument * Also replace "\\n" with " ". */ - + for (ptr = scrptData->string; *ptr != '\0'; ptr++) { if (*ptr == '\n') { *ptr = '\r'; @@ -2718,10 +2719,13 @@ prepareScriptData( } } } - - sysErr = AECreateDesc(typeChar, Tcl_DStringValue(scrptData), - Tcl_DStringLength(scrptData), scrptDesc); - + + Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(scrptData), + Tcl_DStringLength(scrptData), &encodedText); + sysErr = AECreateDesc(typeChar, Tcl_DStringValue(&encodedText), + Tcl_DStringLength(&encodedText), scrptDesc); + Tcl_DStringFree(&encodedText); + if (sysErr != noErr) { sprintf(buffer, "%6d", sysErr); Tcl_DStringFree(scrptData); @@ -2730,7 +2734,7 @@ prepareScriptData( Tcl_DStringAppend(scrptData, " creating Script Data Descriptor.", 33); return TCL_ERROR; } - + return TCL_OK; } |