viでShift_JISやEUC-jpのファイルを文字化けせずに編集する

Windows+Poderosaの環境で、viでShift_JISやEUC-jpのファイルを編集する方法。

export LC_ALL=ja_JP.SJIS

広告

これを打って環境変数を設定しておく。毎回SJISのファイルを扱うわけではないので、設定に書き込まずに毎回コマンドを打つ方針で。

次にPoderosaの「エンコーディング」をshift-jisにしてファイルを開く。

エンコーディングをShift_JIS指定で開いて…

そしてviのコマンドモードで

:set encoding=sjis

と入力。これが大事。

文字化けしてない!できた!

今まで、「なんでshift-jisに指定して開いてもだめなんだろう?」と深く考えずにそのままにしていて、Shift_JISやEUC-jpの古いファイルを開くときは、いつもWinSCPを使ったりと面倒くさいことをしていた。これでもう安心だ。

About: dacelo


7 thoughts on “viでShift_JISやEUC-jpのファイルを文字化けせずに編集する”

  1. Pingback: dacelo
  2. Revolutional update of captcha recognition package “XRumer 19.0 + XEvil”:

    Captcha regignizing of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Hotmail, Mail.Ru, SolveMedia, Steam,
    and more than 12000 another types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can use XEvil 5.0 with any most popular SEO/SMM software: iMacros, XRumer, SERP Parser, GSA SER, RankerX, ZennoPoster, Scrapebox, Senuke, FaucetCollector and more than 100 of other software.

    Interested? You can find a lot of demo videos about XEvil in YouTube.

    P.S. YES, latest version of XEvil solve ReCaptcha-3, used on your website, TOO! As you see ;))

    FREE DEMO AVAILABLE!

    See you later!

    XEvil.Net

  3. Absolutely NEW update of captchas solution software “XRumer 19.0 + XEvil 5.0”:

    Captchas solution of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Hotmail, Mail.Ru, SolveMedia, Hydra,
    and more than 12000 another size-types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can use XEvil 5.0 with any most popular SEO/SMM programms: iMacros, XRumer, SERP Parser, GSA SER, RankerX, ZennoPoster, Scrapebox, Senuke, FaucetCollector and more than 100 of other programms.

    Interested? There are a lot of demo videos about XEvil in YouTube.

    P.S. YES, latest version of XEvil solve ReCaptcha-3, used on your website, TOO! As you see ;))

    FREE DEMO AVAILABLE!

    Good luck!

    XEvil.Net

  4. Incredible update of captcha solving package “XEvil 5.0”:

    Captchas breaking of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Hotmail, Mail.Ru, SolveMedia, Hydra,
    and more than 12000 another categories of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can use XEvil 5.0 with any most popular SEO/SMM programms: iMacros, XRumer, SERP Parser, GSA SER, RankerX, ZennoPoster, Scrapebox, Senuke, FaucetCollector and more than 100 of other software.

    Interested? There are a lot of introducing videos about XEvil in YouTube.

    P.S. YES, latest version of XEvil solve ReCaptcha-3, used on your website, TOO! As you see ;))

    Free XEvil Demo available.

    See you later 😉

    XEvil.Net

  5. Incredible update of captcha solving software “XRumer 19.0 + XEvil”:

    Captchas breaking of Google (ReCaptcha-2 and ReCaptcha-3), Facebook, BitFinex, Bing, MailRu, SolveMedia, Hydra,
    and more than 12000 another size-types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can use XEvil 5.0 with any most popular SEO/SMM programms: iMacros, XRumer, SERP Parser, GSA SER, RankerX, ZennoPoster, Scrapebox, Senuke, FaucetCollector and more than 100 of other programms.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.

    P.S. YES, latest version of XEvil solve ReCaptcha-3, used on your website, TOO! As you see ;))

    Free XEvil Demo available.

    See you later 😉

    XEvil.Net

  6. I am curious to find out what blog system you are using?
    I\’m experiencing some minor security problems with my latest blog and I\’d like to find something more safeguarded.
    Do you have any suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *