Skip to content
Tcl Source Code Artifact [2e0cb49dce]
Login

Artifact [2e0cb49dce]

Artifact 2e0cb49dceb4ac15690758bf8db1492617b7996e:

Ticket change [2e0cb49dce] - New ticket [218361ffffffffff|218361ffff] <i>Tcl_GetEncoding modifing a shared object...</i>. by nobody on 2000-10-26 00:56:42.
D 2000-10-26T00:56:42
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s4180\sBug\nVersion:\s8.3\nSubmitDate:\s'2000-02-15'\nLastModified:\s'2000-04-03'\nSeverity:\sCRIT\nStatus:\sClosed\nSubmitter:\stechsupp\nChangedBy:\shobbs\nOS:\sBSD\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-04-03'\n\n\nName:\nPetasis\sGeorge\n\nReproducibleScript:\nI\shave\swritten\sthis\slittle\sfunction\sfor\sconverting\sbetween\sexternal->UTF:(Strdup\sduplicates\sa\sUTF-8\sstring...)\n\nchar\s*ExternalToUtf(char\s*encoding,\schar\s*str)\s{\n\s\sTcl_DString\sText;\n\s\sTcl_Encoding\senc;\n\s\schar\s*result;\n\n\s\s//My_Interp\sis\sa\sglobal\sthat\scontains\sa\spointer\sto\sthe\sonly\sinterp\smy\sapp\suses...\n\s\s//Tcl_ResetResult(My_Interp);\s//If\syou\sadd\sthis\sthe\sabort\sis\sgone...\n\s\senc\s=\sTcl_GetEncoding(CDM_Interp,\sencoding);\n\s\sif\s(encoding\s==\sNULL)\sreturn\sNULL;\s//\sTcl_GetEncoding\shas\sleft\san\serror...\n\s\sTcl_DStringInit(&Text);\n\s\sresult\s=\sStrdup(Tcl_ExternalToUtfDString(enc,\sstr,\s-1,\s&Text));\n\s\sTcl_DStringFree(&Text);\n\s\sTcl_FreeEncoding(enc);\n\s\sreturn\sresult;\n}\n\nIf\syou\sset\sthe\ssystem\sencoding\s(example)\sto\scp1253\sand\syou\skeep\ncalling\sthis\sfunction\sto\sconvert\sstrings\sto\siso8859-7\n(like:\sExternalToUtf("iso8859-7",\s"some-greek-string\sin\siso8859-7\senc");)\nThen\syou\swill\sget\san\sabort\safter\sa\sfew\siterations...\n\nObservedBehavior:\nWhen\scalling\sTcl_GetEncoding\sand\sTcl_FreeEncoding\smany\stimes\s(i.e.\sin\sa\sloop)\sand\syou\nalways\srequest\sthe\ssame\sencoding(\sbut\sa\sdifferent\sone\sthan\sthe\ssystem\sencoding),\sthen\nwish\scrashes\sunder\swindows\swith\sa\smessage\sabout\sTcl_SetObjLength\smodifing\sa\sshared\nobject.\sI\sthink\sthat\sone\sof\sthese\sfunctions\stries\sto\smodify\sthe\sgiven\sinterpreter\swithout\nchecking\sif\sits\sobject\sis\sshared\sor\snot.\sIf\sI\sput\sTcl_ResetResult\sjust\sbefore\scalling\sthese\nfunctions,\sall\swork\sok.\sThis\sproblem\sis\smuch\seasier\sto\sreproduce\sit\sunder\swindows\sthan\s\nunix...\n\n\n\nThis\slook\ssuspiciously\slike\san\sapp\sthat\sdoesn't\shave\sthe\nTcl_FindExecutable\scall\sthat\sis\snecessary\sfor\s8.1+\sapps\nthat\suse\sencodings.\s\sIs\sthis\sthe\scase?\s\sWe\sneed\sto\ssee\sthe\nstartup\scode\sto\sknow\smore.\s\n--\s04/03/2000\shobbs
J foundin obsolete:\s8.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title Tcl_GetEncoding\smodifing\sa\sshared\sobject...
J type Bug
K 218361ffffffffffffffffffffffffffffffffff
U nobody
Z 7497b4a134e544758221c4abeb1cd4da