.
D 2010-10-13T19:20:32
J icomment There\sis\ssomething\sslightly\sodd\shere.\sThe\scurrent\spageMap\svector\sis\sindexed\sby\san\s11-bit\sinteger\s(11\s=\s16\s-\sOFFSET_BITS),\smeaning\s2048\sdistinct\selements\scan\sbe\saccessed,\sbut\sthe\svector\shas\s5886\selements!\sPresumably\sit\scontains\sdata\salso\sfor\snon-BMP\scharacters\s:-),\seven\sthough\sTcl\scan't\saccess\sit\s:-(.\n\nLooking\sat\suniParse.tcl,\sit\sindeed\sdoes\snot\shave\sany\sprovisions\sfor\signoring\sdata\sif\sthe\scodepoint\sis\sout\sof\srange.\sAnd\swhat\sis\sperhaps\sworse:\sIt\sonly\suses\sthe\sfirst\sfour\shex\sdigits\sas\scodepoint\s(the\sindex\svariable).\sThat's\sa\sbug!\s(So\sthe\sdata\sfor\sunaccessible\scharacters\swas\sprobably\swrong\sanyway.)\n\nSuggested\sfix:\sChange\sthe\slines\n\nscan\s[lindex\s$items\s0]\s%4x\sindex\nset\sindex\s[format\s0x%0.4x\s$index]\n\nto\n\nscan\s[lindex\s$items\s0]\s%x\sindex\n\s\s\s\s\s\s\s\sif\s{$index\s>\s0xFFFF}\sthen\s{\n\s\s\s\s\s\s\s\s\s\s\s\s#\sIgnore\snon-BMP\scharacters,\sas\slong\sas\sTcl\sdoesn't\ssupport\sthem\n\s\s\s\s\s\s\s\s\s\s\s\scontinue\n\s\s\s\s\s\s\s\s}\nset\sindex\s[format\s0x%0.4x\s$index]\n\nI\swouldn't\sbe\ssurprised\sif\sthat\ssolves\sthe\smore-than-256\sgroups\sproblem\sas\swell.\n\n\n
J login lars_h
J mimetype text/plain
J username lars_h
K 3085863fffffffffffffffffffffffffffffffff
U lars_h
Z f9383d06108746a45f673451bfa057d6