diff -Naurd tcl/doc/Eval.3 tcl-enc-option/doc/Eval.3
--- tcl/doc/Eval.3	Tue May 13 23:20:54 2003
+++ tcl-enc-option/doc/Eval.3	Sat May 24 15:55:50 2003
@@ -25,6 +25,9 @@
 \fBTcl_EvalFile\fR(\fIinterp, fileName\fR)
 .sp
 int
+\fBTcl_EvalFileEx\fR(\fIinterp, fileName, encodingName\fR)
+.sp
+int
 \fBTcl_EvalObjv\fR(\fIinterp, objc, objv, flags\fR)
 .sp
 int
@@ -56,6 +59,8 @@
 \fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported.
 .AP "CONST char" *fileName in
 Name of a file containing a Tcl script.
+.AP "CONST char" *encodingName in
+Name of an encoding of the Tcl script.
 .AP int objc in
 The number of objects in the array pointed to by \fIobjPtr\fR;
 this is also the number of words in the command.
diff -Naurd tcl/doc/source.n tcl-enc-option/doc/source.n
--- tcl/doc/source.n	Thu Sep  7 18:27:51 2000
+++ tcl-enc-option/doc/source.n	Sat May 24 15:57:16 2003
@@ -17,6 +17,8 @@
 .SH SYNOPSIS
 \fBsource \fIfileName\fR
 .sp
+\fBsource\fR \fB\-encoding \fIencodingName fileName\fR
+.sp
 \fBsource\fR \fB\-rsrc \fIresourceName \fR?\fIfileName\fR?
 .sp
 \fBsource\fR \fB\-rsrcid \fIresourceId \fR?\fIfileName\fR?
diff -Naurd tcl/doc/tclsh.1 tcl-enc-option/doc/tclsh.1
--- tcl/doc/tclsh.1	Mon Feb 17 16:40:40 2003
+++ tcl-enc-option/doc/tclsh.1	Sat May 24 16:18:50 2003
@@ -14,7 +14,7 @@
 .SH NAME
 tclsh \- Simple shell containing Tcl interpreter
 .SH SYNOPSIS
-\fBtclsh\fR ?\fIfileName arg arg ...\fR?
+\fBtclsh\fR ?-encoding \fIname\fR? ?\fIfileName arg arg ...\fR?
 .BE
 
 .SH DESCRIPTION
diff -Naurd tcl/generic/tcl.decls tcl-enc-option/generic/tcl.decls
--- tcl/generic/tcl.decls	Tue May 13 23:21:08 2003
+++ tcl-enc-option/generic/tcl.decls	Sat May 24 15:41:58 2003
@@ -1797,6 +1797,10 @@
     Tcl_Obj *Tcl_DbNewDictObj(CONST char *file, int line)
 }
 
+declare 505 generic {
+    int Tcl_FSEvalFileEx(Tcl_Interp *interp, Tcl_Obj *fileName,
+            CONST char *encodingName)
+}
 ##############################################################################
 
 # Define the platform specific public Tcl interface.  These functions are
diff -Naurd tcl/generic/tclCmdMZ.c tcl-enc-option/generic/tclCmdMZ.c
--- tcl/generic/tclCmdMZ.c	Tue May 13 23:21:09 2003
+++ tcl-enc-option/generic/tclCmdMZ.c	Sat May 24 15:39:58 2003
@@ -1105,12 +1105,23 @@
     int objc;			/* Number of arguments. */
     Tcl_Obj *CONST objv[];	/* Argument objects. */
 {
-    if (objc != 2) {
-	Tcl_WrongNumArgs(interp, 1, objv, "fileName");
+    CONST char *encodingName = NULL;
+    CONST char *arg;
+
+    if (objc != 2 && objc !=4) {
+	Tcl_WrongNumArgs(interp, 1, objv, "?-encoding name? fileName");
 	return TCL_ERROR;
     }
-
-    return Tcl_FSEvalFile(interp, objv[1]);
+    if (objc == 4) {
+	arg = Tcl_GetString(objv[1]);
+	if (strcmp("-encoding", arg) != 0) {
+	    Tcl_AppendResult(interp, "bad argument\"", arg,
+		    "\": should be -encoding");
+	    return TCL_ERROR;
+	}
+	encodingName = Tcl_GetString(objv[2]);
+    }
+    return Tcl_FSEvalFileEx(interp, objv[1], encodingName);
 }
 
 /*
diff -Naurd tcl/generic/tclDecls.h tcl-enc-option/generic/tclDecls.h
--- tcl/generic/tclDecls.h	Tue May 13 23:21:10 2003
+++ tcl-enc-option/generic/tclDecls.h	Sat May 24 15:42:41 2003
@@ -1606,6 +1606,10 @@
 /* 504 */
 EXTERN Tcl_Obj *	Tcl_DbNewDictObj _ANSI_ARGS_((CONST char * file, 
 				int line));
+/* 505 */
+EXTERN int		Tcl_FSEvalFileEx _ANSI_ARGS_((Tcl_Interp * interp, 
+				Tcl_Obj * fileName, 
+				CONST char * encodingName));
 
 typedef struct TclStubHooks {
     struct TclPlatStubs *tclPlatStubs;
@@ -2170,6 +2174,7 @@
     int (*tcl_DictObjRemoveKeyList) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * dictPtr, int keyc, Tcl_Obj *CONST * keyv)); /* 502 */
     Tcl_Obj * (*tcl_NewDictObj) _ANSI_ARGS_((void)); /* 503 */
     Tcl_Obj * (*tcl_DbNewDictObj) _ANSI_ARGS_((CONST char * file, int line)); /* 504 */
+    int (*tcl_FSEvalFileEx) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * fileName, CONST char * encodingName)); /* 505 */
 } TclStubs;
 
 #ifdef __cplusplus
@@ -4229,6 +4234,10 @@
 #ifndef Tcl_DbNewDictObj
 #define Tcl_DbNewDictObj \
 	(tclStubsPtr->tcl_DbNewDictObj) /* 504 */
+#endif
+#ifndef Tcl_FSEvalFileEx
+#define Tcl_FSEvalFileEx \
+	(tclStubsPtr->tcl_FSEvalFileEx) /* 505 */
 #endif
 
 #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
diff -Naurd tcl/generic/tclIOUtil.c tcl-enc-option/generic/tclIOUtil.c
--- tcl/generic/tclIOUtil.c	Thu May 15 00:56:55 2003
+++ tcl-enc-option/generic/tclIOUtil.c	Sat May 24 15:50:12 2003
@@ -1338,10 +1338,20 @@
     return mode;
 }
 
+/* Tcl_FSEvalFile is Tcl_FSEvalFileEx without encoding argument */
+int
+Tcl_FSEvalFile(interp, pathPtr)
+    Tcl_Interp *interp;		/* Interpreter in which to process file. */
+    Tcl_Obj *pathPtr;		/* Path of file to process.  Tilde-substitution
+				 * will be performed on this name. */
+{
+    return Tcl_FSEvalFileEx(interp, pathPtr, NULL);
+}
+
 /*
  *----------------------------------------------------------------------
  *
- * Tcl_FSEvalFile --
+ * Tcl_FSEvalFileEx --
  *
  *	Read in a file and process the entire file as one gigantic
  *	Tcl command.
@@ -1360,10 +1370,11 @@
  */
 
 int
-Tcl_FSEvalFile(interp, pathPtr)
+Tcl_FSEvalFileEx(interp, pathPtr, encodingName)
     Tcl_Interp *interp;		/* Interpreter in which to process file. */
     Tcl_Obj *pathPtr;		/* Path of file to process.  Tilde-substitution
 				 * will be performed on this name. */
+    CONST char *encodingName;
 {
     int result, length;
     Tcl_StatBuf statBuf;
@@ -1401,6 +1412,18 @@
      * [Bug: 2040]
      */
     Tcl_SetChannelOption(interp, chan, "-eofchar", "\32");
+    /*
+     * If the encoding is specified, set it for the channel.
+     * Else don't touch it (and use the system encoding)
+     * Report error on unknown encoding.
+     */
+    if (encodingName) {
+	if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
+		!= TCL_OK) {
+	    Tcl_Close(interp,chan);
+	    goto end;
+	}
+    }
     if (Tcl_ReadChars(chan, objPtr, -1, 0) < 0) {
         Tcl_Close(interp, chan);
 	Tcl_AppendResult(interp, "couldn't read file \"", 
diff -Naurd tcl/generic/tclMain.c tcl-enc-option/generic/tclMain.c
--- tcl/generic/tclMain.c	Tue May 20 04:58:40 2003
+++ tcl-enc-option/generic/tclMain.c	Sat May 24 16:20:23 2003
@@ -206,6 +206,7 @@
 {
     Tcl_Obj *resultPtr;
     Tcl_Obj *commandPtr = NULL;
+    CONST char *encodingName = NULL;
     char buffer[TCL_INTEGER_SPACE + 5], *args;
     PromptType prompt = PROMPT_START;
     int code, length, tty;
@@ -223,9 +224,22 @@
      * Make command-line arguments available in the Tcl variables "argc"
      * and "argv".  If the first argument doesn't start with a "-" then
      * strip it off and use it as the name of a script file to process.
+     * If the first argument is "-encoding:name" then strip it off and
+     * use as the encoding of the script file.
+     * If the first argument is "-encoding" then use the second one as
+     * the encoding.
      */
 
     if (TclGetStartupScriptPath() == NULL) {
+	if ((argc > 2) && (strcmp(argv[1],"-encoding")==0)) {
+	    encodingName = argv[2];
+	    argc-=2;
+	    argv+=2;
+	} else if ((argc > 1) && (strncmp(argv[1],"-encoding:",10)==0)) {
+	    encodingName = argv[1]+10;
+	    argc--;
+	    argv++;
+	}
 	if ((argc > 1) && (argv[1][0] != '-')) {
 	    TclSetStartupScriptFileName(argv[1]);
 	    argc--;
@@ -289,7 +303,8 @@
      */
 
     if (TclGetStartupScriptPath() != NULL) {
-	code = Tcl_FSEvalFile(interp, TclGetStartupScriptPath());
+	code = Tcl_FSEvalFileEx(interp, TclGetStartupScriptPath(),
+		encodingName);
 	if (code != TCL_OK) {
 	    errChannel = Tcl_GetStdChannel(TCL_STDERR);
 	    if (errChannel) {
diff -Naurd tcl/generic/tclStubInit.c tcl-enc-option/generic/tclStubInit.c
--- tcl/generic/tclStubInit.c	Thu May 15 00:56:56 2003
+++ tcl-enc-option/generic/tclStubInit.c	Sat May 24 15:42:41 2003
@@ -944,6 +944,7 @@
     Tcl_DictObjRemoveKeyList, /* 502 */
     Tcl_NewDictObj, /* 503 */
     Tcl_DbNewDictObj, /* 504 */
+    Tcl_FSEvalFileEx, /* 505 */
 };
 
 /* !END!: Do not edit above this line. */
diff -Naurd tcl/mac/tclMacResource.c tcl-enc-option/mac/tclMacResource.c
--- tcl/mac/tclMacResource.c	Thu May 15 00:57:11 2003
+++ tcl-enc-option/mac/tclMacResource.c	Sat May 24 15:53:20 2003
@@ -946,6 +946,7 @@
     char *fileName = NULL, *rsrcName = NULL;
     long rsrcID = -1;
     char *string;
+    char *encodingName = NULL;
     int length;
 
     if (objc < 2 || objc > 4)  {
@@ -968,6 +969,10 @@
 	if (Tcl_GetLongFromObj(interp, objv[2], &rsrcID) != TCL_OK) {
 	    return TCL_ERROR;
 	}
+    } else if (!strcmp(string, "-encoding")) {
+	if (objc != 4) 
+	    goto sourceFmtErr;
+	encodingName = Tcl_GetString(objv[2]);
     } else {
     	errStr = errBad;
     	goto sourceFmtErr;
@@ -976,13 +981,19 @@
     if (objc == 4) {
 	fileName = Tcl_GetStringFromObj(objv[3], &length);
     }
+
+    if (encodingName) {
+	return Tcl_FSEvalFileEx(interp, fileName, encodingName);
+    }
+
     return Tcl_MacEvalResource(interp, rsrcName, rsrcID, fileName);
 	
     sourceFmtErr:
     Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), errStr, "should be \"",
 		Tcl_GetString(objv[0]), " fileName\" or \"",
 		Tcl_GetString(objv[0]),	" -rsrc name ?fileName?\" or \"", 
-		Tcl_GetString(objv[0]), " -rsrcid id ?fileName?\"",
+		Tcl_GetString(objv[0]), " -rsrcid id ?fileName?\" or \"",
+		Tcl_GetString(objv[0]), " -encoding name fileName\"",
 		(char *) NULL);
     return TCL_ERROR;
 }
