0

这个问题也发布在 AskUbuntu here中。

我有一个标准文本文件,与 cat 完美搭配:

$ cat myfile.txt
v0[shape = Mrecord, label = ""]

当我使用 xxd 检查确切的行尾时,我得到了这个:

$ xxd myfile.txt
00000000: 7630 5b73 6861 7065 203d 204d 7265 636f  v0[shape = Mreco
00000010: 7264 2c20 6c61 6265 6c20 3d20 2222 5d0a  rd, label = ""].

但是,当我尝试用 gedit 打开它时,我得到了一些非拉丁语言的奇怪编码。gedit 出了什么问题?

编辑

以下是复制的完整源代码:

$ cat main.cpp
#include <fstream>
int main(int argc, char **argv)
{
    std::ofstream myfile("myfile.txt");
    myfile << "v0[shape = Mrecord, label = \"\"]\n";
    myfile.close();
    return 0;
}

这是我的编译行:

g++ main.cpp -o main

另外,我附上了 gedit 屏幕的图像文件:

带有非拉丁字母的 gedit prnt scrn

4

0 回答 0