gpt4 book ai didi

encoding - 使用 ASCII 模式通过 FTP 传输 UTF-8 文件?

转载 作者:行者123 更新时间:2023-12-02 19:16:43 25 4
gpt4 key购买 nike

这个问题说明了一切。是否可以使用 ASCII 模式通过 FTP 传输 UTF-8 文件?还是会导致字符写错?谢谢!

最佳答案

  1. UTF-8 编码被设计为向后兼容 ASCII 编码。

  2. RFC 959要求FTP客户端和服务器将ASCII模式的文件视为8位:

    3.1.1.1. ASCII TYPE

    ...

    The sender converts the data from an internal characterrepresentation to the standard 8-bit NVT-ASCIIrepresentation (see the Telnet specification). The receiverwill convert the data from the standard form to his owninternal form.

    In accordance with the NVT standard, the sequenceshould be used where necessary to denote the end of a lineof text. (See the discussion of file structure at the endof the Section on Data Representation and Storage.)

    ...

    Using the standard NVT-ASCII representation means that datamust be interpreted as 8-bit bytes.

<小时/>

因此,即使不知道 UTF-8 的 FTP 客户端或服务器也应该正确翻译行结束符,因为这些行结束符在 ASCII 和 UTF-8 中的编码方式相同。而且他们不应该腐 eclipse 其他角色。

<小时/>

从实际角度来看:我还没有遇到过处理 8 位文本文件时出现问题的服务器。我是捷克人,所以我经常使用 UTF-8,过去也使用 Windows-1250 和 ISO/IEC 8859-2 8 位编码。

关于encoding - 使用 ASCII 模式通过 FTP 传输 UTF-8 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31144985/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com