Skip to content

Instantly share code, notes, and snippets.

@nocd5
Last active August 29, 2015 14:23
Show Gist options
  • Save nocd5/df4b85bd680087473507 to your computer and use it in GitHub Desktop.
Save nocd5/df4b85bd680087473507 to your computer and use it in GitHub Desktop.
(g)vim enc/fenc vs. carsor()/ga

環境

  • Windows8.1
  • kaoriya版 gvim 7.4.648 (32bit)

手順

確認に使用したファイル

  • UTF-8エンコードのutf-8.txt
あいうえお
  • ShiftJISエンコードのsjis.txt
あいうえお

を用意。

実行結果

  1. gvim.exe -u NONE -U NONE -c ":set encoding=utf8" "+e ++enc=utf8 utf8.txt" -c ":call cursor(1,5)" -c ":normal ga"
    カーソル位置 →
    ga → <い> 12356, 16進数 3044, 8進数 30104

  2. gvim.exe -u NONE -U NONE -c ":set encoding=utf8" "+e ++enc=sjis sjis.txt" -c ":call cursor(1,5)" -c ":normal ga"
    カーソル位置 →
    ga → <い> 12356, 16進数 3044, 8進数 30104

  3. gvim.exe -u NONE -U NONE -c ":set encoding=sjis" "+e ++enc=utf8 utf8.txt" -c ":call cursor(1,5)" -c ":normal ga"
    カーソル位置 →
    ga → <う> 33444, 16進数 82a4, 8進数 101244

  4. gvim.exe -u NONE -U NONE -c ":set encoding=sjis" "+e ++enc=sjis sjis.txt" -c ":call cursor(1,5)" -c ":normal ga"
    カーソル位置 →
    ga → <う> 33444, 16進数 82a4, 8進数 101244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment