Re: [twmode-users] 文字[もしく は文字]を含むtweetがポス トできない

2010-01-07 スレッド表示 Yuto Hayamizu

はやみずです

url-hexify-stringで使っているunreserved charactersはRFC2396を参考にして
いるようですが、調べてみたところこのRFCはobsoleteでした。RFC3986を参照
するべきようです。

http://en.wikipedia.org/wiki/Percent-encoding

RFC3986では、丸括弧などもエスケープすべき文字(reserved chars)になっています。

で、この問題の根本は twittering-url-reserved-p の実装ミスですね。
文字chがアルファベットであるかどうかの判定に

(and (= ?A ch) (= ch ?z))

としていたので、Zとaの間にある [ や ] もエスケープしなくてよいとみなさ
れていたわけです。

とりあえずfixしたものを hayamiz/master にコミットしておいたので、確認し
てみてください。手元の環境では、[ や ] を含んだものもcurlを使って投稿で
きています。


Yuto Hayamizu

Master's degree student at Kitsuregawa Laboratory
Department of Information and Communication Engineering
Graduate School of Information Science and Technology
University of Tokyo

From: Tadashi MATSUO t...@mymail.twin.jp
Subject: Re: [twmode-users] 文字[もしくは文字]を含むtweetがポストできない
Date: Wed, 06 Jan 2010 03:32:28 +0900 (JST)

 松尾です。
 
 こちらではcurl(SSL)を使っていないのですが、問題なく
 投稿できるようです。今井さんはcurlをお使いでしょうか。
 twittering-percent-encodeで「[」や「]」が%5bや%5dにencode
 されないのと関係あるのかもしれません。
 
 Emacs 22.1のurl-util.elにある、url-hexify-stringを基にした
 関数で置き換えるパッチを作ってみました。
 http://github.com/hayamiz/twittering-mode/tree/master
 に対する差分です。
 
 twittering-mode.elのあるディレクトリで
 patch -p1  replace-percent-encode.path
 を実行すれば適用できます。
 
 これを適用するとエラーは収まるでしょうか。
 
 ---
 松尾 直志 t...@mymail.twin.jp

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
twmode-users mailing list
twmode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/twmode-users


Re: [twmode-users] 文字[もしく は文字]を含むtweetがポス トできない

2010-01-06 スレッド表示 Tadashi MATSUO
松尾です。

すいません。実行コマンドを

patch -p1  replace-percent-encode.path

のように書いてましたが、添付のファイル名は
replace-percent-encode.patch だったので正しくは

patch -p1  replace-percent-encode.patch

ですね。添付ファイルをreplace-percent-encode.patchの
名前で保存して、上記コマンドを実行すればパッチを適用
できるはずです。

hayamiz/master の dfcedf63dc41bccde8d4e5a998ba964a9bedd1ff
に対する差分なので、現在のHEAD
(de5b424412762ca4990014a8557f7411d2c1c9a5)に適用すると
微調整が行われた旨が出力されるはずです。

こちらでは以下のようになりました。
 $ patch -p1  /tmp/replace-percent-encode.patch
patching file twittering-mode.el
Hunk #2 succeeded at 1217 (offset -2 lines).

---
松尾 直志 t...@mymail.twin.jp

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
twmode-users mailing list
twmode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/twmode-users