小编use*_*912的帖子

iconv:使用BOM从Windows ANSI转换为UTF-8

我想用iconv来转换Mac上的文件.目标是从"Windows ANSI"转到"Windows Notepad保存的任何内容,如果你告诉它使用UFT8".

这就是我要的:

anders-johansen-privats-macbook-pro:test andersprivat$ file names.csv 
names.csv: UTF-8 Unicode (with BOM) text, with CRLF line terminators
Run Code Online (Sandbox Code Playgroud)

这是我使用的:

iconv -f CP1252 -t UTF-8  names.csv > names.utf8.csv 
Run Code Online (Sandbox Code Playgroud)

这就是我得到的(不是我想要的):

file names.utf8.csv 
names.utf8.csv: UTF-8 Unicode text, with CRLF line terminators
Run Code Online (Sandbox Code Playgroud)

我如何获得BOM?

unicode iconv

29
推荐指数
1
解决办法
5万
查看次数

标签 统计

iconv ×1

unicode ×1