Are the binary numbers for the same letter the same in all languages?

WBOY
Release: 2016-08-04 09:20:07
Original
1055 people have browsed it

Process the string "abcde" into binary in php language, read it and process it in other languages ​​(such as go, c), can you still get abcde?

Reply content:

Process the string "abcde" into binary in php language, read it and process it in other languages ​​(such as go, c), can you still get abcde?

Character encoding is used to ensure consistent reading on both sides. As long as they use the same character encoding, they can read each other's characters.

It certainly can. As long as your character encoding is unified, there will be no problem.
If it couldn’t, the programming language would have been a mess long ago.

"How to process the string "abcde" into binary in php language" specifically? Don't talk about logic, show us code.

Computers all use binary systems and are not language-sensitive.

Just make sure the encoding and decoding formats are consistent

First of all, the text does not need special processing, it is stored in binary itself.
Which letter corresponds to which binary number has nothing to do with the programming language. It is all defined by the character set. As long as the same character set is used, no matter which language is used to read and write, there will be no garbled characters.

In addition, In most cases, even if the encoding is different, the English characters will not be garbled. Almost most character sets contain ASCII-compatible codes.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template