.
D 2000-10-26T05:09:54
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s1933\sBug\nVersion:\s8.1b3\nSubmitDate:\s'1999-04-26'\nLastModified:\s'1999-04-26'\nSeverity:\sCRIT\nStatus:\sUnAssn\nSubmitter:\sstanton\nChangedBy:\sstanton\nOS:\sAll\nOSVersion:\sNA\nMachine:\sNA\nFixedDate:\s'2000-10-25'\nFixedInVersion:\sNA\nClosedDate:\s'2000-10-25'\n\n\nIt\sdoes\snot\swork\swell\sunfortunately.\s\sI\sused\sthis\sscript\swith\sthe\scvs\s\nversion\sof\score8.1\son\sDigital-Unix\s4.0B\sand\sLinux\s2.0.36.\s\sI'll\s\ndescribe\sthe\sdetails\sbelow.\s\n\n=====\n#!/usr/new/bin/tclsh8.1\n#\seucjis\n#\sk.furukawa,\sapr.24.1999.\s\n#\sbased\son\smessage\sfrom\sscott\sstanton\n\nset\susage\s"eucjis\s(-eucjjis|-jiseuc)\s(-read|-gets)\s{input-file}\s{output-file}"\nforeach\s{eucjis\sread\sinput\soutput}\s$argv\s{}\nif\s{$output\s==\s""}\s{\sputs\sstderr\s$usage\s;\sexit\s1\s}\nset\sinfile\s[open\s$input\sr]\nset\soutfile\s[open\s$output\sw]\nswitch\s--\s$eucjis\s{\n\s\s\s\s-eucjis\s{\n\s\s\s\s\s\s\s\sfconfigure\s$infile\s-encoding\seuc-jp\n\s\s\s\s\s\s\s\sfconfigure\s$outfile\s-encoding\siso2022-jp\n\s\s\s\s}\s-jiseuc\s{\n\s\s\s\s\s\s\s\sfconfigure\s$infile\s-encoding\siso2022-jp\n\s\s\s\s\s\s\s\sfconfigure\s$outfile\s-encoding\seuc-jp\n\s\s\s\s}\sdefault\s{\sputs\sstderr\s$usage\s;\sexit\s1\s}\n}\nswitch\s--\s$read\s{\n\s\s\s\s-read\s{\n\s\s\s\s\s\s\s\sputs\s-nonewline\s$outfile\s[read\s$infile]\n\s\s\s\s}\s-gets\s{\n\s\s\s\s\s\s\s\swhile\s{[gets\s$infile\sline]\s!=\s-1}\s{\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s$outfile\s$line\n\s\s\s\s\s\s\s\s}\n\s\s\s\s}\sdefault\s{\sputs\sstderr\s$usage\s;\sexit\s1\s}\n}\nclose\s$infile\s;\sclose\s$outfile\n=====\n\n(1)\sOld\scharacter\sset\s(not\sserious)\n\nTexts\sgenerated\sby\stcl's\siso2022-jp\sare\slead\sby\s"<ESC>\s$\s@",\swhich\s\nis\san\sold\ssequence.\s\sRfc1468\sand\srfc1554\ssays\s\n\s\s\s\s\s\sreg#\s\scharacter\sset\s\s\s\s\s\sESC\ssequence\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sdesignated\sto\n\s\s\s\s\s\s------------------------------------------------------------------\n\s\s\s\s\s\s6\s\s\s\s\sASCII\s\s\s\s\s\s\s\s\s\s\s\s\s\sESC\s2/8\s4/2\s\s\s\s\s\sESC\s(\sB\s\s\s\sG0\n\s\s\s\s\s\s42\s\s\s\sJIS\sX\s0208-1978\s\s\s\sESC\s2/4\s4/0\s\s\s\s\s\sESC\s$\s@\s\s\s\sG0\n\s\s\s\s\s\s87\s\s\s\sJIS\sX\s0208-1983\s\s\s\sESC\s2/4\s4/2\s\s\s\s\s\sESC\s$\sB\s\s\s\sG0\n\s\s\s\s\s\s14\s\s\s\sJIS\sX\s0201-Roman\s\s\sESC\s2/8\s4/10\s\s\s\s\sESC\s(\sJ\s\s\s\sG0\nCharacter\ssets\sof\s0208-1978\sand\s0208-1983\sare\sslightly\sdifferent.\s\s\nIf\swe\sdon't\swant\sto\sspecify\sthe\sold\scharacter\sset\sexplicitly,\swe\s\nshould\suse\sthe\snew\scharacter\sset,\s0208-1983,\swhich\sis\slead\sby\s\n"<ESC>\s$\sB".\s\n\n(2)\sUnnecessary\ssequences\s(not\sserious)\n\nIf\sI\sputs\seach\sline\susing\s"-gets"\soption\sabove,\seach\sline\sis\slead\s\nby\s"<ESC>\s(\sB"\sand\sfollowed\sby\s"<ESC>\s(\sB",\seven\sif\sthe\sline\sis\sall\s\ncomposed\sof\sASCII\scharacters.\s\sThey\sare\ssimply\snot\snecessary.\s\sOnly\s\nJapanese\s(0208-1983)\stexts\sshould\sbe\ssurrounded\sby\s"<ESC>\s$\sB"\sand\s\n"<ESC>\s(\sB".\s\n\n(3)\sNot\sconveted\sright\sfrom\siso2022-jp\sto\seuc-jp\s(serious)\n\nI'll\sattach\san\sexample\sfile\sjis1.txt.\s\sThe\sfile\sis\snot\sconverted\s\nright\swith\sa\scommand\s\n"tclsh8.1\seucjis.tcl\s-jiseuc\s-gets\sjis1.txt\seuc1.txt".\s\nThe\slast\scharacter\sshould\sbe\shexadecimal\s<A5><F3>,\swhile\stcl\soutputs\s\nASCII\s"%s".\s\sI\scould\sfind\smany\sexamples.\s\sAnother\sexample\sis\sjis2.txt,\s\nwhich\shas\s5\scharacters\snot\sconverted\sright.\s\n\n(4)\sInfinite\sloop\sin\sconversion\sfrom\seuc-jp\sto\siso2022-jp\s(serious)\n\nIf\sI\sconvert\sline\sby\sline\swith\s"-gets"\soption\sabove,\sthe\sscript\s\nconverts\seuc-jp\stexts\sinto\siso2022-jp,\salthough\sit\scontains\smany\s\nunnecessary\sescape\ssequences\sas\sdescribed\sin\s(2).\s\s\n\nHowever,\sif\sI\suse\s"-read",\sit\ssometimes\sgoes\sinto\san\sinfinite\sloop\sin\s\n"puts",\sand\soutputs\s"<ESC>\s(\sB"\srepeatedly.\s\sIt\sdoes\snot\soccur\swith\s\nshort\stexts.\s\sI'll\sattach\sone\sof\sthe\sexample\sinput\sfile\s"euc.txt".\s\n\nSorry,\sI\sdon't\shave\stime\snow\sto\sdebug\sthe\stcl's\sencoding\ssystem.\s\sBut\s\nif\syou\shave\smore\squestions,\splease\sask\sme.\s\n\njis1.txt\sand\sjis2.txt\sare\sencoded\sin\siso2022-jp,\seuc.txt\sin\seuc-jp.\s\n\nRegards,\sKazuro.\s\n-----\nKazuro\sFURUKAWA\s<[email protected]>\s\s(or\s<[email protected]>)\n\sLinac,\s\sHigh\sEnergy\sAccelerator\sResearch\sOrganization\s(KEK),\sJapan\n\n\nThis\slooks\slike\sthere\smay\sbe\sa\sproblem\swith\sthe\s2022\sencoding.\s\sWe\sneed\sto\sverify\sthe\ssub-tables\sand\spossibly\schange\sthe\sorder\sof\sthe\sprefixes\sin\sthe\sfile\sto\sgive\spreference\sto\sthe\snewer\ssub-encodings.\n\n
J foundin obsolete:\s8.1b3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 57.\szlib
J title iso2022-jp\sencoding\sis\sbroken
J type Bug
K 219283ffffffffffffffffffffffffffffffffff
U nobody
Z 058f11c1482abc37d1e2f8026d8e12d6