summaryrefslogtreecommitdiffstats
path: root/generic/tkOption.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-03 08:45:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-03 08:45:48 (GMT)
commit098b03f8f4259f1767486350c21f5b7e11a6e06b (patch)
treeaad83227050d3fc352558e0158ae131f6e737f96 /generic/tkOption.c
parent312ef46823e21b861e68eeb0073936e15177c0f7 (diff)
downloadtk-098b03f8f4259f1767486350c21f5b7e11a6e06b.zip
tk-098b03f8f4259f1767486350c21f5b7e11a6e06b.tar.gz
tk-098b03f8f4259f1767486350c21f5b7e11a6e06b.tar.bz2
Backout [477949] for Tk 8.5, after discussion in TclCore mailing list: option readfile cannot use multibytes. Ticket [0a3d799a]
To clarify a bit, what we discovered was that [[option readfile]] as found in all Tk releases up to and including 8.5.18 is already able to read in the whole BMP, so long as the file is stored in the encoding utf-8. The classic ASCII subset is fine. utf-8 is fine. Other encodings are at best non-portable. What [477949] did was to add support for files stored in [[encoding system]] but at the expense of breaking the support for the files stored in utf-8. Not the right outcome for a patch release.
Diffstat (limited to 'generic/tkOption.c')
-rw-r--r--generic/tkOption.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/generic/tkOption.c b/generic/tkOption.c
index 17989f8..95b140d 100644
--- a/generic/tkOption.c
+++ b/generic/tkOption.c
@@ -1086,7 +1086,7 @@ ReadOptionFile(
char *buffer;
int result, bufferSize;
Tcl_Channel chan;
- Tcl_DString newName, optString;
+ Tcl_DString newName;
/*
* Prevent file system access in a safe interpreter.
@@ -1136,16 +1136,7 @@ ReadOptionFile(
}
Tcl_Close(NULL, chan);
buffer[bufferSize] = 0;
- if ((bufferSize>2) && !memcmp(buffer, "\357\273\277", 3)) {
- /* File starts with UTF-8 BOM */
- result = AddFromString(interp, tkwin, buffer+3, priority);
- } else {
- Tcl_DStringInit(&optString);
- Tcl_ExternalToUtfDString(NULL, buffer, bufferSize, &optString);
- result = AddFromString(interp, tkwin, Tcl_DStringValue(&optString),
- priority);
- Tcl_DStringFree(&optString);
- }
+ result = AddFromString(interp, tkwin, buffer, priority);
ckfree(buffer);
return result;
}