From: "TAKAGI, Hiromitsu" Date: 2001-12-29T12:44:38+09:00 Subject: [ruby-list:33106] Re: cgi.rb で cookie の encoding について On Sat, 29 Dec 2001 00:38:33 +0900 Wakou Aoyama wrote: > > function cacheCookie(doc, name, value) { > > // Cache the name/value pair in the document's cookie for one year > > var nextyear = new Date(); > > nextyear.setFullYear(nextyear.getFullYear() + 1); > > > > // Must escape the value and date in case they have spaces > > // and/or commas > > var s = name + "=" + escape(value) + ";expires=" + escape(nextyear.toGMTString()); > > > > doc.cookie = s; > > } > > World Wide Web Consortium のサンプルで Must escape となっている、という事 これは、このコードにおいて「space and/or comma」をエスケープする必要が あるということを述べているだけであって、そのためにescape()メソッドがた またま使えるから使っているだけで、escape()メソッドが他にどの文字までも をエスケープするかということについて何か言っているわけではないし、まし てやcookieの仕様として、このescape()メソッドが処理するとおりのエスケー プがmustだと言っているわけではないですよね。 高木 浩光@独立行政法人産業技術総合研究所 http://staff.aist.go.jp/takagi.hiromitsu/