vim9script export def EditWithCP932(options: dict = {}): void EditWith("cp932", options) enddef export def EditWithEUCJP(options: dict = {}): void EditWith("euc-jp", options) enddef export def EditWithISO2022JP(options: dict = {}): void EditWith("iso-2022-jp", options) enddef export def EditWithLatin1(options: dict = {}): void EditWith("latin1", options) enddef export def EditWithShiftJIS(options: dict = {}): void EditWith("shift-jis", options) enddef export def EditWithUTF8(options: dict = {}): void EditWith("utf-8", options) enddef def EditWith(encoding: string, options: dict = {}): void if get(b:, "encoding_configured", false) && !get(options, "force", false) return endif execute $"edit ++encoding={encoding} +set\\ noreadonly" b:encoding_configured = true enddef