Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Encoding troubles



>>>>> "Darren" == Darren Cook <darren@example.com> writes:

    >> I believe there are patches to do this.  But I don't think it's
    >> a good idea.  SJIS is definitely not file-system-safe, unless
    >> you are on a DOS/V box or something like that.

    Darren> Can you explain that further? "/" is not in the SJIS
    Darren> second byte range.  However ` and | are in the second byte
    Darren> range - is that where the problem would come?

Yup.  You're probably OK if you are operating on the command line.
But consider a shell script which does

TODO=`ls`
sh -c "someutility $TODO"

You will get a rather hard to debug syntax error on some SJIS input
unless the shell is SJIS-aware.  This can't happen with EUC or UTF-8.
(In this context the use of a subshell is weird, but it happens all
the time in other contexts.  For example, in programs where you use
the system() function to get path-searching done, which the exec()
family of functions will not do.)

And consider what could happen with [, ], {, and }, all of which
have significance to bash, at least, for globbing and grouping.  And \ 
will just silently disappear from the input.

-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
__________________________________________________________________________
__________________________________________________________________________
What are those two straight lines for?  "Free software rules."
-------------------------------------------------------------------
Next Nomikai: September 17 (Fri), 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Technical Meeting: October 9 (Sat), 13:00     place: Temple Univ.
-------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links