<i>string equality testing does not cover encoding variants</i> status still Open with 4 other changes
by
.
D 2009-02-05T07:31:51
J icomment It\sseems\swe\sare\sclearly\sviolating\sadvice\sgiven\sin\s(uncompiled)\sStringEqualCmd:\n\n\s\s\s*\sRemember\sto\skeep\scode\shere\sin\ssome\ssync\swith\sthe\sbyte-compiled\sversions\n\s\s\s*\sin\stclExecute.c\s(INST_STR_EQ,\sINST_STR_NEQ\sand\sINST_STR_CMP\sas\swell\sas\n\nIndeed\sthe\scode\snear\sthat\scomment\stries\stwo\sshimmer-less\scomparisons\s(ByteArray\sand\sString)\sbefore\sresorting\sto\sGetStringFromObj().\sWhile\sthe\sequivalent\scode\sin\sTEBC\sgoes\sstraight\sto\sit...\nOne\sfirst\sidea\swould\sbe\sto\srespect\sthe\sabove\sadvice\sand\sstick\sto\sperfet\seval-compile\ssymmetry.\nHowever,\sshimmering\sis\sjust\sa\smatter\sof\sspeed\sand\sshouldn't\saffect\sthe\sexternal\sEIAS\ssemantics.\nSo\sit\smight\sbe\sbetter\sto\sremove\sthat\scomment,\ssince\sthe\slack\sof\ssymmetry\shelps\shighlight\sa\snasty\sbug.\n\nNow\sto\sthe\sbug\sitself:\shere\swe\shave\stwo\spure-strep's\s(results\sfrom\s[encoding\sconvertfrom\sidentity]),\swhich\sare\stwo\sdifferent\sUTF-8\sstrings.\sBy\scalling\s[string\slength]\son\sthem\swe\scompute\stheir\sString(unicode)\sintrep,\swhich\shappen\sto\sbe\sthe\ssame.\sThen\swhen\swe\scall\sthe\snon-compiled\svariant\sof\s[string\sequal]\swe\shit\sthe\sshimmer-less\scase,\scomparing\son\sthe\s(equal)\sunicode\sstrings.\n\nSo\sit\sseems\swe\shave\sa\ssituation\ssimilar\sto\snon-canonical\slists\sthat\swould\sbe\scompared\son\stheir\sList\sintreps.\nThe\ssolution\swould\sbe\sto\sadd\ssimilarly\san\s"isCanonical"\sflag\sto\sthe\sString\sintrep,\sand\stake\sthat\sflag\sinto\saccount\sin\sthe\s"fast-track"\scomparisons\s(ie\sforbid\ssuch\scomparisons\son\sall\sbut\scanonical\sStrings).\n\nMore\sgenerally\sthis\swould\sbe\sthe\scase\sof\sany\sintrep\sthat\sis\s"fast-tracked"\sin\sone\sof\sthe\sequality\stests\sand\sfails\sto\srecord\sdeviation\sfrom\scanonicity.\n
J login ferrieux
J mimetype text/plain
J username ferrieux
K 2564363fffffffffffffffffffffffffffffffff
U ferrieux
Z a08f66c8b03c4af9334db9d0f23ddfab