encoding - 如何在 Notepad++ 中将文件的编码转换为 ISO-8859-1?

标签 encoding notepad++ iso-8859-1

我有一个 UTF-8 格式的文件,我需要将其转换为 iso-8859-1。我知道notepad++可以转换编码,例如你点击转换为ANSI,你修改了你的文件,你可以通过变成红色的保存按钮看到它。我知道转换是改变字节,这就是我想要的!但我不知道如何在 Notepad++ 中选择我想要的编码。只有 5 种编码可供选择:ANSI;无 BOM 的 UTF-8; UTF-8; UCS-2 大端; UCS-2 小尾数。我该如何选择另一个?

最佳答案

  • 使用编码 -> 转换为 ANSI
  • 使用编码 -> 字符集 -> 西欧 -> ISO 8859-1。

  • 假设您有一个文件 enc_test.txt,创建为 UTF-8,内容为 Ä (带点的德语变音符号“A”):

    在第 1 步之前:
    cat -A enc_test.txt 
    M-CM-^D
    
    cat  enc_test.txt 
    Ä
    
    stat enc_test.txt 
      File: 'enc_test.txt'
      Size: 2               Blocks: 8          IO Block: 4096   regular file
    Device: 811h/2065d      Inode: 2885375     Links: 1
    Access: (0664/-rw-rw-r--)  Uid: ( 1000/      lf)   Gid: ( 1000/      lf)
    Access: 2016-05-20 16:56:40.852021989 +0200
    Modify: 2016-05-20 16:56:40.376021976 +0200
    Change: 2016-05-20 16:56:40.376021976 +0200
     Birth: -
    

    在第 2 步(文件自动保存)之后,输出(在设置为 UTF-8 的终端中)为:
    cat -A enc_test.txt 
    M-D
    
    cat  enc_test.txt 
    ?
    
    stat enc_test.txt 
      File: 'enc_test.txt'
      Size: 1               Blocks: 8          IO Block: 4096   regular file
    Device: 811h/2065d      Inode: 2885375     Links: 1
    Access: (0664/-rw-rw-r--)  Uid: ( 1000/      lf)   Gid: ( 1000/      lf)
    Access: 2016-05-20 16:58:10.444024488 +0200
    Modify: 2016-05-20 16:58:10.404024487 +0200
    Change: 2016-05-20 16:58:10.404024487 +0200
     Birth: -
    
    cat -A 的大小字段和输出告诉我们发生了什么事。

    关于encoding - 如何在 Notepad++ 中将文件的编码转换为 ISO-8859-1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37328429/

    相关文章:

    encoding - 如何将 Dart 的 ByteData 转换为字符串?

    python - 在python中准确提取PEM格式的公钥为 "Decimal"

    c# - 如何在Twitter更新中处理ISO-2022-JP(和其他字符集)?

    regex - Notepad++ 查找/替换正则表达式帮助

    python - 在 python 中将 em-dash 转换为连字符

    C# 或 VB.NET : How to programatically change encoding format to UTF-8 of all text files in a given directory?

    regex - 在Notepad++中删除最后一个数字之前的字符

    regex - Notepad++查找并用正则表达式替换

    php - CSV 从 UTF8 到 ISO-8859-1

    python - unicode解码的问题