<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Sealyu

    --- 博客已遷移至: http://www.sealyu.com/blog

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評論 :: 0 Trackbacks

    問題就是我們使用TextMate不支持GB2312等編碼,用著及其不方便,下面是解決方案:

    打開Bundle Editor
    選則Show all

    選則文件夾TextMate(或者隨便你選則什么)
    增加一個新的template‘openEncodedFile’(或者隨便你自己命名)
    在Template data中如下設定
    Extension:中 留空

    Command(s):

    # open CocoaDialog’s file select menu

    file=$(CocoaDialog fileselect \
    --title "Open an encoded file" \
    --with-directory $HOME/ \
    )
    # check for valid file
    if [ -n "$file" ]; then
    # open CocoaDialog's dropdown menu
    # for more encodings add them to '--items'
    # to list all possibile encodings use the Terminal with 'iconv -l'
    res=$(CocoaDialog dropdown \
    --title "Open an encoded file" \
    --text "Choose the encoding:" \
    ??exit?onchange \
    --button1 "Open" \
    --button2 "Cancel" \
    --items "BIG5" "EUC-TW" "GB2312" "SJIS" "EUC-JP" "KOI8-R" \
    )
    # if user canceled exit
    [[ $( (tail -r &amp;lt;&amp;lt;&amp;lt;"$res") | tail -n1) == "2" ]] &amp;amp;&amp;amp; \
    exit_discard
    res=$(tail -n1 &amp;lt;&amp;lt;&amp;lt;"$res")
    # add more 'elif' according to '--items' if needed
    if [ "$res" == 0 ]; then
    ENC="BIG5"
    elif [ "$res" == 1 ]; then
    ENC="EUC-TW"
    elif [ "$res" == 2 ]; then
    ENC="GB2312"
    elif [ "$res" == 3 ]; then
    ENC="SJIS"
    elif [ "$res" == 4 ]; then
    ENC="EUC-JP"
    elif [ "$res" == 5 ]; then
    ENC="KOI8-R"
    fi
    # start conversion to UTF-8 and send the result as a new file back to TM
    iconv -f "$ENC" -t utf-8 "$file" &amp;gt; "$TM_NEW_FILE"
    fi
    Output: Insert as Text - Activation: Key Equivalent shift+option+o (我的建議) - Scope: 留空

    posted on 2010-09-08 19:40 seal 閱讀(559) 評論(0)  編輯  收藏 所屬分類: Apple
    主站蜘蛛池模板: 亚洲精品免费观看| 一区二区在线免费观看| 亚洲高清在线mv| 久久久久亚洲AV成人网人人软件| 成人黄页网站免费观看大全| 国产成人久久AV免费| 一级人做人a爰免费视频 | 99视频免费在线观看| 无码天堂va亚洲va在线va| 亚洲已满18点击进入在线观看| 日韩精品一区二区亚洲AV观看| 亚洲中文字幕无码日韩| 免费人成年激情视频在线观看| 麻豆国产人免费人成免费视频| 曰曰鲁夜夜免费播放视频| 24小时日本电影免费看| 久久久久免费看黄a级试看| 你懂的网址免费国产| 中文永久免费观看网站| 一区二区三区在线免费| 一级毛片正片免费视频手机看 | 无码国产精品一区二区免费I6| 最近中文字幕免费完整| 热re99久久6国产精品免费| 99久久免费国产精品热| 大地资源中文在线观看免费版| 亚洲第一视频在线观看免费| 一级一级毛片免费播放| 一级做a爰全过程免费视频毛片 | 中文字幕亚洲第一| 国产性爱在线观看亚洲黄色一级片 | 国产成人午夜精品免费视频| 一区二区三区四区免费视频| 99视频在线免费看| 曰批全过程免费视频播放网站 | 亚洲福利在线视频| 亚洲视频.com| 亚洲国产成+人+综合| 亚洲一卡2卡3卡4卡国产网站| 久久久久久亚洲精品影院| 亚洲国产成人久久综合|