Code: Select all
--- eggdrop1.6.18.orig/src/tcl.c 2006-03-28 04:35:50.000000000 +0200
+++ eggdrop1.6.18/src/tcl.c 2007-12-26 23:52:50.000000000 +0100
@@ -339,7 +339,7 @@
utftot += sizeof(char *) * objc;
objc -= 5;
for (i = 0; i < objc; i++) {
- byteptr = (char *) Tcl_GetByteArrayFromObj(objv[i], &len);
+ byteptr = (char *) Tcl_GetStringFromObj(objv[i], &len);
strings[i] = (char *) nmalloc(len + 1);
utftot += len + 1;
strncpy(strings[i], byteptr, len);
Code: Select all
--- eggdrop1.6.18.original/src/main.h 2006-03-28 04:35:50.000000000 +0200
+++ eggdrop1.6.18.utf8/src/main.h 2008-04-01 20:57:29.000000000 +0200
@@ -44,7 +44,7 @@
#endif
#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 1)) || (TCL_MAJOR_VERSION > 8))
-# define USE_TCL_BYTE_ARRAYS
+# undef USE_TCL_BYTE_ARRAYS
# define USE_TCL_ENCODING
#endif
diff -ur eggdrop1.6.18.original/src/tcl.c eggdrop1.6.18.utf8/src/tcl.c
--- eggdrop1.6.18.original/src/tcl.c 2006-03-28 04:35:50.000000000 +0200
+++ eggdrop1.6.18.utf8/src/tcl.c 2008-04-01 20:55:48.000000000 +0200
@@ -650,7 +650,7 @@
if (encoding == NULL) {
encoding = "iso8859-1";
}
-
+ encoding = "utf-8";
Tcl_SetSystemEncoding(NULL, encoding);
Code: Select all
moff@HAL-9000:~/eggsource/eggdrop1.6.19$ patch -p0 < utf8patch.patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|--- eggdrop1.6.19.original/src/main.h 2006-03-28 04:35:50.000000000 +0200
|+++ eggdrop1.6.19.utf8/src/main.h 2008-04-01 20:57:29.000000000 +0200
--------------------------
File to patch:
moff@HAL-9000:~/eggsource/eggdrop1.6.19$ patch -p1 < utf8patch.patch
patching file src/main.h
patching file src/tcl.c
Hunk #1 FAILED at 650.
1 out of 1 hunk FAILED -- saving rejects to file src/tcl.c.rej
moff@HAL-9000:~/eggsource/eggdrop1.6.19$
You should be fine, since the important change in the main.h was done without errors. Just make sure that your bot runs on a shell with utf-8 enabled environment.moff wrote:i get these errors... can someone help me please?
The future is now! Well, at least it is in response to the script mentioned above. Lately some development time has been found and that investment of time has now lead us to where we are today. See here for details, but suffice it to say that the modded version of incith google I've provided does in fact now fully support this patch method. So I encourage all those using this script and wanting truly multi-language utf-8 compliant script with perfect renderings of every character in both input and output I can now safely suggest you rush to patch your bots. EnjoyMellowB wrote:Jep, can confirm that this is working. My eggdrop (1.6.19) is accepting and outputting UTF-8 correctly now, at least if the script that's used supports this.
Unfortunately most of the scripts, like the modded version of incith's google tcl by speechless do not since they use own workarounds and thus break it again. (it works semi fine with an unpatched bot and all the workarounds in the script but still not perfect, so using this patch here would be much better)
So yeah, thanks for the tip there thommey, this sure could be helpful in the future!
Code: Select all
[*******@liberty (~/eggdrop1.6.19)]$ patch -p1 < utf8patch.patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|
|--- eggdrop1.6.19.original/src/main.h 2006-03-28 04:35:50.000000000 +0200
|+++ eggdrop1.6.19.utf8/src/main.h 2008-04-01 20:57:29.000000000 +0200
--------------------------
Patching file src/main.h using Plan A...
Hunk #1 succeeded at 44.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ur eggdrop1.6.19.original/src/tcl.c eggdrop1.6.19.utf8/src/tcl.c
|--- eggdrop1.6.19.original/src/tcl.c 2006-03-28 04:35:50.000000000 +0200
|+++ eggdrop1.6.19.utf8/src/tcl.c 2008-04-01 20:55:48.000000000 +0200
--------------------------
Patching file src/tcl.c using Plan A...
Hunk #1 failed at 650.
1 out of 1 hunks failed--saving rejects to src/tcl.c.rej
done
[*******@liberty (~/eggdrop1.6.19)]$