2007-03-27 Firefox拡張機能「It’s All Text!」を使ってみた

これはなかなか。ブログを書くには便利かもしれない。
秀丸で書くのはそこそこ快適ではあるが、はてな記法はちょっと使いづらいかも?
僕はWindowsXPを使っていてユーザ名に日本語文字列を使っている。
こうした場合、「It's All Text!」から秀丸を起動しようとするときに作成するファイル名が文字化けを起こすため、エラーで怒られてしまった。
ちょこっとパッチを当てて回避したのでメモしときます。
ファイル名:cacheobj.js
メソッド名:CacheObj.prototype.edit
このエディタを起動する寸前の処理にUTF-8のパス名をShift-JISへ変換してあげた。
// Run the process.
// If first param is true, calling thread will be blocked until
// called process terminates.
// Second and third params are used to pass command-line arguments
// to the process.
/* firerabbit chg start*/
var conv = Components.
classes["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
conv.charset = "Shift_JIS";
var filename = conv.ConvertFromUnicode(filename) ;
/* firerabbit chg end*/
var args = [filename];
var result = {};
process.run(false, args, args.length, result);