字节序仅影响数字而不是字符串的内存布局,这是真的吗? [英] Is it true that endianness only affects the memory layout of numbers,but not string?

查看:69
本文介绍了字节序仅影响数字而不是字符串的内存布局,这是真的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确实是体系结构是大字节序还是小字节序,只有数字的内存布局不同,字符串的内存布局是相同的。

Is it true that whether the architecture is big or little endian ,only the memory layout of numbers differ,that of the string is the same.

推荐答案

如果您有一个简单的8位字符表示形式(例如扩展的ASCII),则不会,字节序不会影响布局,因为每个字符都是一个字节。

If you have a simple 8-bit character representation (e.g. extended ASCII), then no, endianness does not affect the layout, because each character is one byte.

如果您具有多字节表示形式,例如UTF-16,则可以,字节顺序仍然很重要(请参见例如 http://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes )。

If you have a multi-byte representation, such as UTF-16, then yes, endianness is still important (see e.g. http://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes).

这篇关于字节序仅影响数字而不是字符串的内存布局,这是真的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆