Questa è una versione PDF del contenuto. Per la versione completa e aggiornata, visita:
https://blog.tuttosemplice.com/en/the-underscore-ascii-and-unicode-code-comparison/
Verrai reindirizzato automaticamente...
The underscore, that little symbol "_" that we use daily on keyboards and screens, is a fundamental element in the world of computing. We often take it for granted, but behind this simple character lies a world of codes and standards that allow for its correct representation and interpretation by computers. In this article, we will explore the underscore in depth, analyzing its ASCII and Unicode encoding , and discovering how it is used in programming languages, operating systems, and SEO.
The underscore , also known as the low line , is a typographic character consisting of a horizontal line positioned at the bottom of the text line. Its history dates back to typewriters, where it was used to underline words before the advent of bold or italic text. Today, the underscore plays a crucial role in computer science, finding use in various contexts:
nome_variabile , calcola_area ), improving code readability.relazione_annuale_2023.pdf ).Fun fact: In old typewriters, the "_" symbol was often used in combination with the backspace key to create a continuous underline. You would type the symbol, go back with the backspace key, and repeat the operation for the entire length of the word to be underlined.
To fully understand how the underscore works in computer science, it is essential to know the concept of character encoding. ASCII (American Standard Code for Information Interchange) is one of the earliest and most important encoding standards. Developed in the 1960s, ASCII uses 7 bits to represent 128 characters, including uppercase and lowercase letters , numbers, punctuation symbols, and control characters.
| Character | Decimal Code | Hexadecimal Code |
|---|---|---|
| A | 65 | 41 |
| a | 97 | 61 |
| 0 | 48 | 30 |
| ! | 33 | 21 |
| _ | 95 | 5F |
As can be seen from the table, the underscore in ASCII has decimal code 95 and hexadecimal code 5F .
Despite its historical importance, ASCII has limitations. With only 128 characters, it is unable to represent the wide range of symbols and special characters found in different languages around the world.
Further information: To overcome the limitations of ASCII, several extensions have been developed, such as extended ASCII , which uses 8 bits to represent 256 characters. However, these extensions are not universal and may vary depending on the operating system and language.
Unicode was created to meet the need for a universal encoding system capable of representing all characters in all languages of the world. This standard assigns a unique code to each character, regardless of language, platform, or program.
Unicode offers several types of encoding:
In Unicode, the underscore is represented by the code U+005F . This code is identical in all Unicode encodings, ensuring compatibility between different systems.
Focus: Unicode has revolutionized the way software is localized for different languages. Thanks to this standard, it is possible to develop applications that support a wide range of characters and languages, making software accessible to a global audience.
The underscore plays an important role in many programming languages. Let's look at some examples:
int numero_elementi; ).String nomeUtente; )._ is used to indicate a temporary variable or a value that will not be used.Best practice: For better code readability, it is advisable to use the underscore consistently and follow the conventions of the programming language you are using.
The use of the underscore in file and folder names may vary depending on the operating system:
Examples: A file name such as report_vendite_2023_Q1.xlsx is perfectly valid in all operating systems. However, a file name such as _file_nascosto.txt might cause problems in Windows.
The underscore also plays an important role in terms of SEO. Search engines, such as Google, consider the underscore as a word separator in URLs.
Tips for using the underscore for SEO purposes:
Case study: Websites like Wikipedia and Amazon use the underscore in URLs to improve the readability and indexing of their pages.
| Feature | ASCII | Unicode |
|---|---|---|
| Number of characters | 128 | Over 143,000 |
| Encoding | 7 bits | UTF-8 (1-4 bytes), UTF-16 (2-4 bytes), UTF-32 (4 bytes) |
| Language support | Limited to English and some Western languages | Supports all languages of the world |
| Flexibility | Low | High |
| Compatibility | Compatibility issues between different platforms | Guaranteed compatibility between different systems. |
Character encoding is a fundamental aspect of computer science. ASCII and Unicode, with their different characteristics and functionalities, have enabled the representation and exchange of textual information in an increasingly efficient and universal way. The underscore, a seemingly simple symbol, is an example of how encoding standards are essential to ensure compatibility between different systems and languages.
The evolution of encoding standards continues, with new challenges and opportunities on the horizon. Unicode, with its ability to represent a wide range of characters, is destined to play an increasingly important role in the era of globalization and digital communication.
To stay up-to-date on the latest news in the IT field and delve deeper into topics such as character encoding, I invite you to subscribe to the TuttoSemplice.com newsletter. You will find articles, guides, and useful resources to improve your digital skills.
The underscore () is a typographic character found at the bottom of the line of text, while the hyphen (-) is a punctuation symbol used to join words or indicate a range.
Yes, the underscore is generally accepted in email addresses.
On the Italian keyboard, the underscore is obtained by pressing the Shift key (the one on the right) and the key immediately to its left simultaneously.
Yes, using underscores in URLs can affect SEO. Google tends to interpret the underscore as a word separator, so it is advisable to use it to separate keywords in URLs.
If you use non-ASCII characters in a document and open it on a system that does not support these characters, you may see incorrect or illegible symbols.