Linux.yaroslavl.ru
В этой главе описаны макросы (которые также доступны как процедуры) для классификации знаков в различные категории (алфавитные, числовые, yпpавляющие, пpобелы и так далее) или для выполнения простых операций с ними.
Макросы определяются в файле ctype.h.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isalnum.
isalnum возвращает ненулевое значение, если c — буква (a-z или a-z) или цифра (0-9).
Стандарт ANSI требует наличия функции isalnum.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isalpha.
isalpha возвращает ненулевое значение, если c — буква (A-Z или a-z).
Стандарт ANSI требует наличия функции isalpha.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isascii.
isascii возвращает ненулевое значение, если младший байт c лежит между 0 и 127 (0x00-0x7f)
Стандарт ANSI требует наличия функции isascii.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef iscntrl.
iscntrl возвращает ненулевое значение, если c -знак удаления или простой управляющий знак (0x7f или 0x00-0x1f).
Стандарт ANSI требует наличия функции iscntrl.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isdigit.
isdigit возвращает ненулевое значение, если c — десятичная цифра (0-9).
Стандарт ANSI требует наличия функции isdigit.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef islower.
islower возвращает ненулевое значение, если c — строчная буква (a-z).
Стандарт ANSI требует наличия функции islower.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isprint.
isprint возвращает ненулевое значение, если c — видимый знак (0x20-0x7e), isgraph работает точно также, за исключением обработки пробела (0x20).
Стандарт ANSI требует наличия функций isprint и isgraph.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef ispunct.
ispunct возвращает ненулевое значение, если c — видимый знак препинания (isgraph(c) && !isalnum(c)).
Стандарт ANSI требует наличия функции ispunct.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isspace.
isspace возвращает ненулевое значение, если c — пробел, tab, возврат каретки, новая строка, вертикальный tab или formfeed (0x00-0x0d,0x20).
Стандарт ANSI требует наличия функции isspace.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isupper.
isupper возвращает ненулевое значение, если c — прописная буква (a-z).
Стандарт ANSI требует наличия функции isupper.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef isxdigit.
isxdigit возвращает ненулевое значение, если c — шеснадцатиричная цифра (0-9, a-f или a-f).
Стандарт ANSI требует наличия функции isxdigit.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef toascii.
toascii возвращает целое от 0 до 127.
Стандарт ANSI не требует наличия функции toascii.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef tolower.
_tolower выполняет то же самое преобразование, но может использоваться только с прописными буквами A-Z.
tolower возвращает строчный эквивалент c, если это знак от A до Z, и c в противном случае.
_tolower возвращает строчный эквивалент c, если это знак от A до Z, в противном случае поведение этого макро не определено.
Стандарт ANSI требует наличия функции tolower. _tolower не рекомендуется использовать в переносимых системах.
Никаких процедур ОС не требуется.
Вы можете использовать откомпилированную процедуру вместо определения макро, отменяя определение макро при помощи #undef toupper.
_toupper выполняет то же самое преобразование, но может использоваться только со строчными буквами a-z.
toupper возвращает прописной эквивалент c, если это знак от a до z, и c в противном случае.
_toupper возвращает прописной эквивалент c, если это знак от a до z, в противном случае поведение этого макро не определено.
Стандарт ANSI требует наличия функции toupper. _toupper не рекомендуется использовать в переносимых системах.
Как использовать функцию tolower для символов, отличных от ascii
Я пытаюсь применить более низкую функцию к не-ASCII символам. Следующий код не работает в среде Linux (Ubuntu), но работает в Windows.
Я попытался установить языковые пакеты, но ничего не вышло. Может ли кто-нибудь мне помочь, что мне не хватает в этом коде?
Решение
::tolower() опирается на текущий языковой стандарт, установленный в библиотеке C. По умолчанию «C» locale гарантированно обрабатывает только символы ASCII. Microsoft, вероятно, использует другую локаль по умолчанию, которая соответствует текущей локали пользователя. Это объясняет, почему код может работать в Windows.
использование ::setlocale() установить желаемый язык для ::tolower() использовать. В противном случае используйте переносимую библиотеку Unicode, такую как ICU .
toascii man page
toascii — convert character to ASCII
Synopsis
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
toascii(): _XOPEN_SOURCE
|| /* Glibc since 2.19: */ _DEFAULT_SOURCE
|| /* Glibc versions
Description
toascii() converts c to a 7-bit unsigned char value that fits into the ASCII character set, by clearing the high-order bits.
Return Value
The value returned is that of the converted character.
Attributes
For an explanation of the terms used in this section, see attributes(7).
Interface | Attribute | Value |
---|---|---|
toascii() | Thread safety | MT-Safe |
Conforming to
SVr4, BSD, POSIX.1-2001. POSIX.1-2008 marks toascii() as obsolete, noting that it cannot be used portably in a localized application.
Many people will be unhappy if you use this function. This function will convert accented letters into random characters.
ToAscii function
Translates the specified virtual-key code and keyboard state to the corresponding character or characters. The function translates the code using the input language and physical keyboard layout identified by the keyboard layout handle.
To specify a handle to the keyboard layout to use to translate the specified code, use the ToAsciiEx function.
Syntax
Parameters
The virtual-key code to be translated. See Virtual-Key Codes.
The hardware scan code of the key to be translated. The high-order bit of this value is set if the key is up (not pressed).
Type: const BYTE*
A pointer to a 256-byte array that contains the current keyboard state. Each element (byte) in the array contains the state of one key. If the high-order bit of a byte is set, the key is down (pressed).
The low bit, if set, indicates that the key is toggled on. In this function, only the toggle bit of the CAPS LOCK key is relevant. The toggle state of the NUM LOCK and SCROLL LOCK keys is ignored.
The buffer that receives the translated character or characters.
This parameter must be 1 if a menu is active, or 0 otherwise.
Return Value
If the specified key is a dead key, the return value is negative. Otherwise, it is one of the following values.
Return value | Description |
---|---|
The specified virtual key has no translation for the current state of the keyboard. | |
1 | One character was copied to the buffer. |
2 | Two characters were copied to the buffer. This usually happens when a dead-key character (accent or diacritic) stored in the keyboard layout cannot be composed with the specified virtual key to form a single character. |
Remarks
The parameters supplied to the ToAscii function might not be sufficient to translate the virtual-key code, because a previous dead key is stored in the keyboard layout.
Typically, ToAscii performs the translation based on the virtual-key code. In some cases, however, bit 15 of the uScanCode parameter may be used to distinguish between a key press and a key release. The scan code is used for translating ALT+ number key combinations.
Although NUM LOCK is a toggle key that affects keyboard behavior, ToAscii ignores the toggle setting (the low bit) of lpKeyState (VK_NUMLOCK) because the uVirtKey parameter alone is sufficient to distinguish the cursor movement keys (VK_HOME, VK_INSERT, and so on) from the numeric keys (VK_DECIMAL, VK_NUMPAD0 — VK_NUMPAD9).
tolower/toupper utf-8, koi8-r
Помогите с переводом строки в верхний и нижний регистры. Функция должна работать как для однобайтовой кодировке, так и для многобайтовой.
Относительно многобайтовой кодировки, проблему _временно_ решил переводом строки из кодировки nl_langinfo (CODESET) в UTF-8 и затем переводом в кодировку понимаемую glib’ом через g_utf8_get_char/g_utf8_next_char и использованием g_unichar_tolower. Получилось коряво =(, если подскажете как перевести в glib’овский юникод из nl_langinfo (CODESET), скажу спасибо. Это был вопрос номер раз.
Вопрос номер два. Если я использую nl_langinfo (CODESET) для идентификации текущей кодировки, и если кодировка nl_langinfo (CODESET) однобайтовая, то зачем мне перекодировать строку, когда я спокойно могу воспользоваться glibc’ными tolower и toupper?! И вот вопос, как определить, что кодировка nl_langinfo (CODESET) однобайтовая?
Re: tolower/toupper utf-8, koi8-r
Относительно первого вопроса, guint32 содержит символ в кодировке UCS-4, так что можно сразу переводить в эту кодировку минуя utf-8.
Но второй вопрос все еще актуален
Re: tolower/toupper utf-8, koi8-r
Для С++
изменение кодировок iconv
изменение регистра STL
std::string Upper(const std::string p)
<
std::string ret = p;
transform(ret.begin(), ret.end(), ret.begin(), toupper);
return (ret);
>
Re: tolower/toupper utf-8, koi8-r
Юзать функции для локалей?
Re: tolower/toupper utf-8, koi8-r
>Юзать функции для локалей?
Re: tolower/toupper utf-8, koi8-r
>изменение кодировок iconv
вопрос не в перекодировке, она уже решена при помощи iconv некоторое время назад.
> изменение регистра STL std::string Upper(const std::string p)
а теперь попробуй привести к верхенму регистру строку, состоящую из кирилицы в кодировке UTF-8. (для однобайтовых кодировок с правильной локалью сработает, а вот с UTF-8 не работает)
Re: tolower/toupper utf-8, koi8-r
теоретически если вызвать setlocale, то потом будут работать корректно остальные функции, но я с этим не работал в си, только в C++ c их stlными аналогами, в частности isalpha корректно работала для всех языков.
Re: tolower/toupper utf-8, koi8-r
вот код (у меня системная кодировка — UTF-8), файл test.c:
#include
#include
#include
#include
#include
int main () <
setlocale (LC_CTYPE, ENC);
char* source_str = «тест»;
size_t source_str_length = strlen (source_str);
char* target_str = (char*) malloc (source_str_length + 1);
char *c = source_str;
size_t i = 0;
for (; *c != 0; c++, i++)
target_str [i] = toupper (source_str [i]);
target_str [source_str_length] = ‘\0’;
printf («%s\n», target_str);
>
Если запустить iconv -f utf-8 -t koi8-r test.c > test-koi8.c && gсс test-koi8.c -DENC=»\»ru_RU.KOI8-R\»» && ./a.out | iconv -f koi8 -t utf-8
То выведеться «ТЕСТ».
Но если вызвать как gcc test.c -DENC=»\»ru_RU.UTF-8\»» && ./a.out
То абсолютно естественно, что выводиться «тест», ибо один мультибайтный символ, просто разбивается на несколько частей.
Re: tolower/toupper utf-8, koi8-r
Для мультибайтных вроде нужно использовать wchar_t ?
Re: tolower/toupper utf-8, koi8-r
wchar_t не портабельно это раз.
Два кодировка wchar_t != UTF-8 и предеться переводить из одной кодировки в другую (что сейчас и делается, но мне это не нравиться)
и три как мне узнать, что кодировка nl_langinfo (CODESET) (текущая системная кодировка) многобайтовая?
Re: tolower/toupper utf-8, koi8-r
s/предеться/придеться/1 s/Два кодировка/Два, кодировка/1 s/и три как мне узнать/и три, как мне узнать/1
чорт, русская языка!
Re: tolower/toupper utf-8, koi8-r
> wchar_t не портабельно это раз.
почему ж не портабельно ? wchar_t предназначено для _внутреннего_ представления широких символов (unicode) и ему ж не нужно никуда портироватся ж.
входной текст ковертируется из локальной кодировки (mb — может быть utf-8 или однобайтной) во внутреннее представление (wchar_t), обрабатывается [wcslen, towlower, fwide, wprintf, . ] и при выводе из программы — конвертируется обратно в локаль (mb)
портабельно, описано в стандартах POSIX IEEE Std 1003.1-2001, C99
Re: tolower/toupper utf-8, koi8-r
ответа на Ваш второй вопрос не знаю, но есть предположение что единственная мультибайтная кодировка в unix’ах, которую можно поставить в качестве кодировки локали — это UTF-8 (так как она совместима с однобайтными и соответственно с стандартными системными функциями типа open(char*, . ) и т.д.). хотя я в этом не уверен.
Stroustroup belongs to a durka or to a pogost!
Вместо map toUpper s —
> transform(ret.begin(), ret.end(), ret.begin(), toupper);
Вот за это мы и любим С++.
Re: tolower/toupper utf-8, koi8-r
>почему ж не портабельно ? wchar_t предназначено для _внутреннего_ представления широких символов (unicode) и ему ж не нужно никуда портироватся ж.
ну если только для внутреннего, тогда да, некуда портироваться.
>входной текст ковертируется из локальной кодировки (mb — может быть utf-8 или однобайтной) во внутреннее представление (wchar_t), обрабатывается [wcslen, towlower, fwide, wprintf, . ] и при выводе из программы — конвертируется обратно в локаль (mb)
задача стоит перевести в верхний/нижний регистры конкретные строки, которые могут быть и в KOI8-R и в UTF-8. Но двойную перекодировку из текущей в юникод и из юникода в текущую я уже делаю, а upper’ю и lower’ю с помощь glib.
Но я хотел обойтись без перекодировок, хотя бы для однобайтовых символов (к сожалению, фишка в том, что надо определить однобайтовость кодировки в runtime)
>портабельно, описано в стандартах POSIX IEEE Std 1003.1-2001, C99
я не спорю, может и написано. но увы, wchar_t виндовый != wchar_t glibc =(
Re: tolower/toupper utf-8, koi8-r
>ответа на Ваш второй вопрос не знаю, но есть предположение что единственная мультибайтная кодировка в unix’ах, которую можно поставить в качестве кодировки локали — это UTF-8 (так как она совместима с однобайтными и соответственно с стандартными системными функциями типа open(char*, . ) и т.д.). хотя я в этом не уверен.
на мой взгляд, UTF-8 — лучший вариант представления юникодного символа, из-за совместимости c US-ASCII. Но. уже сейчас перед глазами, задача перевода из верхнего в нижний регистр и UTF-8 и UTF-16 (тот, что wchar_t в windows)
QChar Class Reference
The QChar class provides a 16-bit Unicode character. Далее.
Замечание: Все функции в этом классе реентерабельны.
Открытые типы
enum | Category |
enum | Decomposition |
enum | Direction |
enum | Joining |
enum | SpecialCharacter |
enum | UnicodeVersion |
Открытые функции
QChar () | |
QChar ( char ch ) | |
QChar ( uchar ch ) | |
QChar ( QLatin1Char ch ) | |
QChar ( uchar cell, uchar row ) | |
QChar ( ushort code ) | |
QChar ( short code ) | |
QChar ( uint code ) | |
QChar ( int code ) | |
QChar ( SpecialCharacter ch ) | |
Category | category () const |
uchar | cell () const |
unsigned char | combiningClass () const |
QString | decomposition () const |
Decomposition | decompositionTag () const |
int | digitValue () const |
Direction | direction () const |
bool | hasMirrored () const |
bool | isDigit () const |
bool | isHighSurrogate () const |
bool | isLetter () const |
bool | isLetterOrNumber () const |
bool | isLowSurrogate () const |
bool | isLower () const |
bool | isMark () const |
bool | isNull () const |
bool | isNumber () const |
bool | isPrint () const |
bool | isPunct () const |
bool | isSpace () const |
bool | isSymbol () const |
bool | isTitleCase () const |
bool | isUpper () const |
Joining | joining () const |
QChar | mirroredChar () const |
uchar | row () const |
char | toAscii () const |
QChar | toCaseFolded () const |
char | toLatin1 () const |
QChar | toLower () const |
QChar | toTitleCase () const |
QChar | toUpper () const |
ushort & | unicode () |
ushort | unicode () const |
UnicodeVersion | unicodeVersion () const |
Статические открытые члены
Category | category ( uint ucs4 ) |
Category | category ( ushort ucs2 ) |
unsigned char | combiningClass ( uint ucs4 ) |
unsigned char | combiningClass ( ushort ucs2 ) |
QString | decomposition ( uint ucs4 ) |
Decomposition | decompositionTag ( uint ucs4 ) |
int | digitValue ( ushort ucs2 ) |
int | digitValue ( uint ucs4 ) |
Direction | direction ( uint ucs4 ) |
Direction | direction ( ushort ucs2 ) |
QChar | fromAscii ( char c ) |
QChar | fromLatin1 ( char c ) |
ushort | highSurrogate ( uint ucs4 ) |
bool | isHighSurrogate ( uint ucs4 ) |
bool | isLowSurrogate ( uint ucs4 ) |
Joining | joining ( uint ucs4 ) |
Joining | joining ( ushort ucs2 ) |
ushort | lowSurrogate ( uint ucs4 ) |
uint | mirroredChar ( uint ucs4 ) |
ushort | mirroredChar ( ushort ucs2 ) |
bool | requiresSurrogates ( uint ucs4 ) |
uint | surrogateToUcs4 ( ushort high, ushort low ) |
uint | surrogateToUcs4 ( QChar high, QChar low ) |
uint | toCaseFolded ( uint ucs4 ) |
ushort | toCaseFolded ( ushort ucs2 ) |
uint | toLower ( uint ucs4 ) |
ushort | toLower ( ushort ucs2 ) |
uint | toTitleCase ( uint ucs4 ) |
ushort | toTitleCase ( ushort ucs2 ) |
uint | toUpper ( uint ucs4 ) |
ushort | toUpper ( ushort ucs2 ) |
UnicodeVersion | unicodeVersion ( uint ucs4 ) |
UnicodeVersion | unicodeVersion ( ushort ucs2 ) |
Связанные нечлены класса
bool | operator!= ( QChar c1, QChar c2 ) |
bool | operator ( QChar c1, QChar c2 ) |
bool | operator>= ( QChar c1, QChar c2 ) |
QDataStream & | operator>> ( QDataStream & in, QChar & chr ) |
Подробное описание
The QChar class provides a 16-bit Unicode character.
In Qt, Unicode characters are 16-bit entities without any markup or structure. This class represents such an entity. It is lightweight, so it can be used everywhere. Most compilers treat it like a unsigned short.
QChar provides a full complement of testing/classification functions, converting to and from other formats, converting from composed to decomposed Unicode, and trying to compare and case-convert if you ask it to.
The classification functions include functions like those in the standard C++ header (formerly ), but operating on the full range of Unicode characters. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull() (returns true if the character is ‘\0’), isPrint() (true if the character is any sort of printable character, including whitespace), isPunct() (any sort of punctation), isMark() (Unicode Mark), isLetter() (a letter), isNumber() (any sort of numeric character, not just 0-9), isLetterOrNumber(), and isDigit() (decimal digits). All of these are wrappers around category() which return the Unicode-defined category of each character.
QChar also provides direction(), which indicates the «natural» writing direction of this character. The joining() function indicates how the character joins with its neighbors (needed mostly for Arabic) and finally hasMirrored(), which indicates whether the character needs to be mirrored when it is printed in its «unnatural» writing direction.
Composed Unicode characters (like ?) can be converted to decomposed Unicode («a» followed by «ring above») by using decomposition().
In Unicode, comparison is not necessarily possible and case conversion is very difficult at best. Unicode, covering the «entire» world, also includes most of the world’s case and sorting problems. operator==() and friends will do comparison based purely on the numeric Unicode value (code point) of the characters, and toUpper() and toLower() will do case changes when the character has a well-defined uppercase/lowercase equivalent. For locale-dependent comparisons, use QString::localeAwareCompare().
The conversion functions include unicode() (to a scalar), toLatin1() (to scalar, but converts all non-Latin-1 characters to 0), row() (gives the Unicode row), cell() (gives the Unicode cell), digitValue() (gives the integer value of any of the numerous digit characters), and a host of constructors.
QChar provides constructors and cast operators that make it easy to convert to and from traditional 8-bit chars. If you defined QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII, as explained in the QString documentation, you will need to explicitly call fromAscii() or fromLatin1(), or use QLatin1Char, to construct a QChar from an 8-bit char, and you will need to call toAscii() or toLatin1() to get the 8-bit value back.
Описание типов-членов
enum QChar:: Category
This enum maps the Unicode character categories.
The following characters are normative in Unicode:
Константа | Значение | Описание |
---|---|---|
QChar::Mark_NonSpacing | 1 | Unicode class name Mn |
QChar::Mark_SpacingCombining | 2 | Unicode class name Mc |
QChar::Mark_Enclosing | 3 | Unicode class name Me |
QChar::Number_DecimalDigit | 4 | Unicode class name Nd |
QChar::Number_Letter | 5 | Unicode class name Nl |
QChar::Number_Other | 6 | Unicode class name No |
QChar::Separator_Space | 7 | Unicode class name Zs |
QChar::Separator_Line | 8 | Unicode class name Zl |
QChar::Separator_Paragraph | 9 | Unicode class name Zp |
QChar::Other_Control | 10 | Unicode class name Cc |
QChar::Other_Format | 11 | Unicode class name Cf |
QChar::Other_Surrogate | 12 | Unicode class name Cs |
QChar::Other_PrivateUse | 13 | Unicode class name Co |
QChar::Other_NotAssigned | 14 | Unicode class name Cn |
The following categories are informative in Unicode:
Константа | Значение | Описание |
---|---|---|
QChar::Letter_Uppercase | 15 | Unicode class name Lu |
QChar::Letter_Lowercase | 16 | Unicode class name Ll |
QChar::Letter_Titlecase | 17 | Unicode class name Lt |
QChar::Letter_Modifier | 18 | Unicode class name Lm |
QChar::Letter_Other | 19 | Unicode class name Lo |
QChar::Punctuation_Connector | 20 | Unicode class name Pc |
QChar::Punctuation_Dash | 21 | Unicode class name Pd |
QChar::Punctuation_Open | 22 | Unicode class name Ps |
QChar::Punctuation_Close | 23 | Unicode class name Pe |
QChar::Punctuation_InitialQuote | 24 | Unicode class name Pi |
QChar::Punctuation_FinalQuote | 25 | Unicode class name Pf |
QChar::Punctuation_Other | 26 | Unicode class name Po |
QChar::Symbol_Math | 27 | Unicode class name Sm |
QChar::Symbol_Currency | 28 | Unicode class name Sc |
QChar::Symbol_Modifier | 29 | Unicode class name Sk |
QChar::Symbol_Other | 30 | Unicode class name So |
QChar::NoCategory | Qt cannot find an appropriate category for the character. |
enum QChar:: Decomposition
This enum type defines the Unicode decomposition attributes. See the Unicode Standard for a description of the values.
Константа | Значение |
---|---|
QChar::NoDecomposition | |
QChar::Canonical | 1 |
QChar::Circle | 8 |
QChar::Compat | 16 |
QChar::Final | 6 |
QChar::Font | 2 |
QChar::Fraction | 17 |
QChar::Initial | 4 |
QChar::Isolated | 7 |
QChar::Medial | 5 |
QChar::Narrow | 13 |
QChar::NoBreak | 3 |
QChar::Small | 14 |
QChar::Square | 15 |
QChar::Sub | 10 |
QChar::Super | 9 |
QChar::Vertical | 11 |
QChar::Wide | 12 |
enum QChar:: Direction
This enum type defines the Unicode direction attributes. See the Unicode Standard for a description of the values.
In order to conform to C/C++ naming conventions «Dir» is prepended to the codes used in the Unicode Standard.
Константа | Значение |
---|---|
QChar::DirAL | 13 |
QChar::DirAN | 5 |
QChar::DirB | 7 |
QChar::DirBN | 18 |
QChar::DirCS | 6 |
QChar::DirEN | 2 |
QChar::DirES | 3 |
QChar::DirET | 4 |
QChar::DirL | |
QChar::DirLRE | 11 |
QChar::DirLRO | 12 |
QChar::DirNSM | 17 |
QChar::DirON | 10 |
QChar::DirPDF | 16 |
QChar::DirR | 1 |
QChar::DirRLE | 14 |
QChar::DirRLO | 15 |
QChar::DirS | 8 |
QChar::DirWS | 9 |
enum QChar:: Joining
This enum type defines the Unicode joining attributes. See the Unicode Standard for a description of the values.
Константа | Значение |
---|---|
QChar::Center | 3 |
QChar::Dual | 1 |
QChar::OtherJoining | |
QChar::Right | 2 |
enum QChar:: SpecialCharacter
Константа | Значение | Описание |
---|---|---|
QChar::Null | 0x0000 | A QChar with this value isNull(). |
QChar::Nbsp | 0x00a0 | Non-breaking space. |
QChar::ReplacementCharacter | 0xfffd | The character shown when a font has no glyph for a certain codepoint. A special question mark character is often used. Codecs use this codepoint when input data cannot be represented in Unicode. |
QChar::ObjectReplacementCharacter | 0xfffc | Used to represent an object such as an image when such objects cannot be presented. |
QChar::ByteOrderMark | 0xfeff | |
QChar::ByteOrderSwapped | 0xfffe | |
QChar::ParagraphSeparator | 0x2029 | |
QChar::LineSeparator | 0x2028 |
enum QChar:: UnicodeVersion
Specifies which version of the Unicode standard introduced a certain character.
Константа | Значение | Описание |
---|---|---|
QChar::Unicode_1_1 | 1 | Version 1.1 |
QChar::Unicode_2_0 | 2 | Version 2.0 |
QChar::Unicode_2_1_2 | 3 | Version 2.1.2 |
QChar::Unicode_3_0 | 4 | Version 3.0 |
QChar::Unicode_3_1 | 5 | Version 3.1 |
QChar::Unicode_3_2 | 6 | Version 3.2 |
QChar::Unicode_4_0 | 7 | Version 4.0 |
QChar::Unicode_4_1 | 8 | Version 4.1 |
QChar::Unicode_5_0 | 9 | Version 5.0 |
QChar::Unicode_Unassigned | The value is not assigned to any character in version 5.0 of Unicode. |
Описание функций-членов
QChar:: QChar ()
Constructs a null QChar (‘\0’).
QChar:: QChar ( char ch )
Constructs a QChar corresponding to ASCII/Latin-1 character ch.
QChar:: QChar ( uchar ch )
Constructs a QChar corresponding to ASCII/Latin-1 character ch.
QChar:: QChar ( QLatin1Char ch )
Constructs a QChar corresponding to ASCII/Latin-1 character ch.
QChar:: QChar ( uchar cell, uchar row )
Constructs a QChar for Unicode cell cell in row row.
QChar:: QChar ( ushort code )
Constructs a QChar for the character with Unicode code point code.
QChar:: QChar ( short code )
Constructs a QChar for the character with Unicode code point code.
QChar:: QChar ( uint code )
Constructs a QChar for the character with Unicode code point code.
QChar:: QChar ( int code )
Constructs a QChar for the character with Unicode code point code.
QChar:: QChar ( SpecialCharacter ch )
Constructs a QChar for the predefined character value ch.
Category QChar:: category () const
Returns the character’s category.
Category QChar:: category ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the category of the UCS-4-encoded character specified by ucs4.
Эта функция была введена в Qt 4.3.
Category QChar:: category ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the category of the UCS-2-encoded character specified by ucs2.
uchar QChar:: cell () const
Returns the cell (least significant byte) of the Unicode character.
unsigned char QChar:: combiningClass () const
Returns the combining class for the character as defined in the Unicode standard. This is mainly useful as a positioning hint for marks attached to a base character.
The Qt text rendering engine uses this information to correctly position non-spacing marks around a base character.
unsigned char QChar:: combiningClass ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the combining class for the UCS-4-encoded character specified by ucs4, as defined in the Unicode standard.
unsigned char QChar:: combiningClass ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the combining class for the UCS-2-encoded character specified by ucs2, as defined in the Unicode standard.
QString QChar:: decomposition () const
Decomposes a character into its parts. Returns an empty string if no decomposition exists.
QString QChar:: decomposition ( uint ucs4 ) [static]
Это перегруженная функция.
Decomposes the UCS-4-encoded character specified by ucs4 into its constituent parts. Returns an empty string if no decomposition exists.
Decomposition QChar:: decompositionTag () const
Returns the tag defining the composition of the character. Returns QChar::Single if no decomposition exists.
Decomposition QChar:: decompositionTag ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the tag defining the composition of the UCS-4-encoded character specified by ucs4. Returns QChar::Single if no decomposition exists.
int QChar:: digitValue () const
Returns the numeric value of the digit, or -1 if the character is not a digit.
int QChar:: digitValue ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the numeric value of the digit, specified by the UCS-2-encoded character, ucs2, or -1 if the character is not a digit.
int QChar:: digitValue ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the numeric value of the digit specified by the UCS-4-encoded character, ucs4, or -1 if the character is not a digit.
Direction QChar:: direction () const
Returns the character’s direction.
Direction QChar:: direction ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the direction of the UCS-4-encoded character specified by ucs4.
Direction QChar:: direction ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the direction of the UCS-2-encoded character specified by ucs2.
QChar QChar:: fromAscii ( char c ) [static]
Converts the ASCII character c to its equivalent QChar. This is mainly useful for non-internationalized software.
An alternative is to use QLatin1Char.
QChar QChar:: fromLatin1 ( char c ) [static]
Converts the Latin-1 character c to its equivalent QChar. This is mainly useful for non-internationalized software.
bool QChar:: hasMirrored () const
Returns true if the character should be reversed if the text direction is reversed; otherwise returns false.
ushort QChar:: highSurrogate ( uint ucs4 ) [static]
Returns the high surrogate value of a ucs4 code point. The returned result is undefined if ucs4 is smaller than 0x10000.
bool QChar:: isDigit () const
Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false.
bool QChar:: isHighSurrogate () const
Returns true if the QChar is the high part of a utf16 surrogate (ie. if its code point is between 0xd800 and 0xdbff, inclusive).
bool QChar:: isHighSurrogate ( uint ucs4 ) [static]
Returns true if the UCS-4-encoded character specified by ucs4 is the high part of a utf16 surrogate (ie. if its code point is between 0xd800 and 0xdbff, inclusive).
Эта функция была введена в Qt 4.7.
bool QChar:: isLetter () const
Returns true if the character is a letter (Letter_* categories); otherwise returns false.
bool QChar:: isLetterOrNumber () const
Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise returns false.
bool QChar:: isLowSurrogate () const
Returns true if the QChar is the low part of a utf16 surrogate (ie. if its code point is between 0xdc00 and 0xdfff, inclusive).
bool QChar:: isLowSurrogate ( uint ucs4 ) [static]
Returns true if the UCS-4-encoded character specified by ucs4 is the high part of a utf16 surrogate (ie. if its code point is between 0xdc00 and 0xdfff, inclusive).
Эта функция была введена в Qt 4.7.
bool QChar:: isLower () const
Returns true if the character is a lowercase letter, i.e. category() is Letter_Lowercase.
bool QChar:: isMark () const
Returns true if the character is a mark (Mark_* categories); otherwise returns false.
See QChar::Category for more information regarding marks.
bool QChar:: isNull () const
Returns true if the character is the Unicode character 0x0000 (‘\0’); otherwise returns false.
bool QChar:: isNumber () const
Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns false.
bool QChar:: isPrint () const
Returns true if the character is a printable character; otherwise returns false. This is any character not of category Cc or Cn.
Note that this gives no indication of whether the character is available in a particular font.
bool QChar:: isPunct () const
Returns true if the character is a punctuation mark (Punctuation_* categories); otherwise returns false.
bool QChar:: isSpace () const
Returns true if the character is a separator character (Separator_* categories); otherwise returns false.
bool QChar:: isSymbol () const
Returns true if the character is a symbol (Symbol_* categories); otherwise returns false.
bool QChar:: isTitleCase () const
Returns true if the character is a titlecase letter, i.e. category() is Letter_Titlecase.
Эта функция была введена в Qt 4.3.
bool QChar:: isUpper () const
Returns true if the character is an uppercase letter, i.e. category() is Letter_Uppercase.
Joining QChar:: joining () const
Returns information about the joining properties of the character (needed for certain languages such as Arabic).
Joining QChar:: joining ( uint ucs4 ) [static]
Это перегруженная функция.
Returns information about the joining properties of the UCS-4-encoded character specified by ucs4 (needed for certain languages such as Arabic).
Joining QChar:: joining ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns information about the joining properties of the UCS-2-encoded character specified by ucs2 (needed for certain languages such as Arabic).
ushort QChar:: lowSurrogate ( uint ucs4 ) [static]
Returns the low surrogate value of a ucs4 code point. The returned result is undefined if ucs4 is smaller than 0x10000.
QChar QChar:: mirroredChar () const
Returns the mirrored character if this character is a mirrored character; otherwise returns the character itself.
uint QChar:: mirroredChar ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the mirrored character if the UCS-4-encoded character specified by ucs4 is a mirrored character; otherwise returns the character itself.
ushort QChar:: mirroredChar ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the mirrored character if the UCS-2-encoded character specified by ucs2 is a mirrored character; otherwise returns the character itself.
bool QChar:: requiresSurrogates ( uint ucs4 ) [static]
Returns true if the UCS-4-encoded character specified by ucs4 can be splited to the high and low parts of a utf16 surrogate (ie. if its code point is greater than or equals to 0x10000).
Эта функция была введена в Qt 4.7.
uchar QChar:: row () const
Returns the row (most significant byte) of the Unicode character.
uint QChar:: surrogateToUcs4 ( ushort high, ushort low ) [static]
Converts a UTF16 surrogate pair with the given high and low values to its UCS-4 code point.
uint QChar:: surrogateToUcs4 ( QChar high, QChar low ) [static]
Converts a utf16 surrogate pair (high, low) to its ucs4 code point.
char QChar:: toAscii () const
Returns the character value of the QChar obtained using the current codec used to read C strings, or 0 if the character is not representable using this codec. The default codec handles Latin-1 encoded text, but this can be changed to assist developers writing source code using other encodings.
The main purpose of this function is to preserve ASCII characters used in C strings. This is mainly useful for developers of non-internationalized software.
QChar QChar:: toCaseFolded () const
Returns the case folded equivalent of the character. Для большинства Unicode-символов это тоже самое, что и toLower().
uint QChar:: toCaseFolded ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the case folded equivalent of the UCS-4-encoded character specified by ucs4. Для большинства Unicode-символов это тоже самое, что и toLower().
ushort QChar:: toCaseFolded ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the case folded equivalent of the UCS-2-encoded character specified by ucs2. Для большинства Unicode-символов это тоже самое, что и toLower().
char QChar:: toLatin1 () const
Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software.
QChar QChar:: toLower () const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the character itself.
uint QChar:: toLower ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the lowercase equivalent of the UCS-4-encoded character specified by ucs4 if the character is uppercase or titlecase; otherwise returns the character itself.
ushort QChar:: toLower ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the lowercase equivalent of the UCS-2-encoded character specified by ucs2 if the character is uppercase or titlecase; otherwise returns the character itself.
QChar QChar:: toTitleCase () const
Returns the title case equivalent if the character is lowercase or uppercase; otherwise returns the character itself.
uint QChar:: toTitleCase ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the title case equivalent of the UCS-4-encoded character specified by ucs4 if the character is lowercase or uppercase; otherwise returns the character itself.
ushort QChar:: toTitleCase ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the title case equivalent of the UCS-2-encoded character specified by ucs2 if the character is lowercase or uppercase; otherwise returns the character itself.
QChar QChar:: toUpper () const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the character itself.
uint QChar:: toUpper ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the uppercase equivalent of the UCS-4-encoded character specified by ucs4 if the character is lowercase or titlecase; otherwise returns the character itself.
ushort QChar:: toUpper ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the uppercase equivalent of the UCS-2-encoded character specified by ucs2 if the character is lowercase or titlecase; otherwise returns the character itself.
ushort & QChar:: unicode ()
Returns a reference to the numeric Unicode value of the QChar.
ushort QChar:: unicode () const
Это перегруженная функция.
UnicodeVersion QChar:: unicodeVersion () const
Returns the Unicode version that introduced this character.
UnicodeVersion QChar:: unicodeVersion ( uint ucs4 ) [static]
Это перегруженная функция.
Returns the Unicode version that introduced the character specified in its UCS-4-encoded form as ucs4.
UnicodeVersion QChar:: unicodeVersion ( ushort ucs2 ) [static]
Это перегруженная функция.
Returns the Unicode version that introduced the character specified in its UCS-2-encoded form as ucs2.
Связанные нечлены класса
bool operator!= ( QChar c1, QChar c2 )
Returns true if c1 and c2 are not the same Unicode character; otherwise returns false.
bool operator ( QChar c1, QChar c2 )
Returns true if the numeric Unicode value of c1 is less than that of c2; otherwise returns false.
QDataStream & operator ( QDataStream & out, const QChar & chr )
Writes the char chr to the stream out.
bool operator ( QChar c1, QChar c2 )
Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.
bool operator== ( QChar c1, QChar c2 )
Returns true if c1 and c2 are the same Unicode character; otherwise returns false.
bool operator> ( QChar c1, QChar c2 )
Returns true if the numeric Unicode value of c1 is greater than that of c2; otherwise returns false.
bool operator>= ( QChar c1, QChar c2 )
Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.
QDataStream & operator>> ( QDataStream & in, QChar & chr )
Reads a char from the stream in into char chr.
Все остальные торговые марки являются собственностью их владельцев. Политика конфиденциальности
Лицензиаты, имеющие действительные коммерческие лицензии Qt, могут использовать этот документ в соответствии с соглашениями коммерческой лицензии Qt, поставляемой с программным обеспечением, либо, альтернативно, в соответствии с условиями, содержащимися в письменном соглашении между вами и Nokia.
Кроме того, этот документ может быть использован в соответствии с условиями GNU Free Documentation License version 1.3, опубликованной фондом Free Software Foundation.
toascii(3) — Linux man page
toascii — convert character to ASCII
Synopsis
Description
toascii() converts c to a 7-bit unsigned char value that fits into the ASCII character set, by clearing the high-order bits.
Return Value
The value returned is that of the converted character.
Conforming To
SVr4, BSD, POSIX.1-2001. POSIX.1-2008 marks toascii() as obsolete, noting that it cannot be use portably in a localized application.
Many people will be unhappy if you use this function. This function will convert accented letters into random characters.
NBSP — что это? Пустое место, имеющее значение
Простой пробел и специальный символ схожи только в одном: они означают разделение слов, тегов, атрибутов и прочих элементов разметки. Однако использование обычного пробела актуально только для повышения читабельности содержимого страницы и ради удобства работы с ней в текстовом редакторе.
Для браузера и его языка JavaScript количество пробелов между словами, тегами и другими элементами не имеет никакого значения.
Применение пробелов
Пробел — самый нужный символ. Хоть он «пустой», но очень полезный. Даже в старые добрые времена, когда имели важное значение такие символы, как «перевод строки» и «возврат каретки», любое количество пробелов в любом месте кода применялось только для повышения его читабельности. Но само по себе пустое место «очень ценилось».
Правильно манипулировать словами, ключевыми словами и синтаксическими конструкциями, отличать код программы от комментария по сей день ни один компилятор (интерпретатор) не научился. Без знатных лексем вроде паскалевского (pascal) «:=» и пээлевской (PL/1) «;», валютно-ориентированного новшества «Пэхапе» (PHP) — «$» в имени переменной обошелся, разве что «Фортран», у которого каждому оператору надлежало находиться в отдельной строке.
Принципиально сказанное означает, что естественной способности разделять слова и фразы, отличать фразы от предложений, а в последних улавливать законченный смысл у искусственных языков по-прежнему нет.
Но простой пробел может быть в любом количестве в любой строке, и у него есть обязательный цифровой код. Пробел — это не пустое место ни в коде, ни в значении переменной. Это очень важный символ. Следовательно, значение имеет и nbsp. Что это? Сейчас рассмотрим.
Идеальная система: то, чего нет, но так необходимо
Многие области применения письма и вывода контента требуют точного соблюдения правил оформления. Простой пример — списки.
- __первая строка;
- _вторая строка;
- третья строка.
- первая строка;
- вторая строка;
- третья строка.
Здесь символ «_» обозначает простой пробел, который может быть указан по ошибке или образуется вследствие выравнивания текста элемента списка по обеим сторонам абзаца.
Принципиально, что содержание элемента списка должно следовать сразу за номером. В частности, текстовый редактор MS Word еще в самом начале своего существования предложил использовать неразрывный пробел (комбинация клавиш ctrl+»пробел»), чтобы запретить разрыв между элементами строки.
Неразрывный пробел склеивал два соседних слова, причем совершенно не обязательно, чтобы они оба были таковыми. А в случае списков, когда номер элемента не входит в содержание абзаца, склеивание выполняется к началу строки.
В те времена, когда MS Word уже пользовался неизменным успехом, язык гипертекста еще только формировался, но наличие в нем специальных символов предполагалось изначально. Другое дело   — что это такое и зачем оно нужно, не сразу было понятно.
Использование в заголовках
Правильный заголовок не разрывается, а слова в нем не переносятся. Он центрируется или выравнивается по той или иной стороне. Без использования неразрывного пробела трудно обойтись.
В языке гипертекста это будет выглядеть так:
7. 5. Руководство по инсталляции FreeBSD
На HTML-странице в браузере номер заголовка будет выглядеть так: «7. 5. » и все, таким образом оформленные заголовки будут строго одинаковыми.
Есть момент, на который стоит обратить внимание, если в заголовке используется текст и картинка. Браузер все выводит последовательно, именно так, как определено входящим потоком. Тег img располагается в самом начале строки, но чтобы текст разместился сразу за картинкой, нужно учесть ее ширину.
Использование в контенте страницы
Абсолютное позиционирование текста в редких случаях может помочь. Обычно заголовки и текст идут одним потоком, но с разными тегами, например h2 и p.
Чтобы сместить текст вправо от картинки, очень удобно применить несколько .
В следующем примере необходимо вывести иконки типов загружаемых файлов и написать рядом соответствующие расширения текстом.
Кодирование выполнено на PHP с использованием nbsp. Что это такое и как используется? Теперь становится ясно. Аналогично символ неразрывного пробела применяется в JavaScript.
Применение в строках
При обработке строк (как на сервере, так и внутри браузера) неразрывный пробел не используется — слишком накладно применять вместо одного значимого символа » «, целых шесть » «. Однако, когда строка отправляется в вывод, в поток браузера, необходимо перекодировать все символы пробела в надлежащее количество неразрывных пробелов.
Вывод в echo или print_r последовательности более одного пробела не будет иметь нужного эффекта и контент «поползет». Например (PHP):
- echo «2____Привет!»; // здесь «_» обозначает символ » «.
- echo «2 Привет!»
Будут иметь различный эффект, если тег имеет выравнивание justify. В первом случае цифра 2 будет напечатана с левого края блока, в который был сделан вывод, а текст «Привет!» — с правого.
NBSP — что это и как применять? Важная информация
Между тем, проблема вовсе не в пробелах. Непечатаемых символов на самом деле очень много, и далеко не всегда они используются правильно. Стоит вспомнить, как оформляют документы пользователи MS Word. Когда нужно написать слово «директор» слева, а его фамилию справа, подавляющее большинство лепят подряд несколько символов табуляции — быстро и эффективно.
Вместо того, чтобы правильно выставить значение символа табуляции и выравнивание на нем, пользователь нажимает несколько раз tab и получает нужный эффект.
Аналогичная ситуация в языке разметки HTML. Многие разработчики не используют специальные символы правильно, не применяют нужные стили так, как это положено делать, и результат: «Привет, Мир, я 3-й раз ошибся. » — будет растянут по всей ширине блока, в которую эта строка была выведена.
Если перекодировать строку в «Привет Мир, я 3-й раз ошибся. » — результат будет именно таким, каким он должен быть.
Знать и использовать специальные символы — очень хорошая идея. Особенно если у вас есть желание делать эффективные и качественные страницы, в которых контент расположен качественно и аккуратно.
Почему ToUpper быстрее, чем ToLower?
Я запускаю много раз:
Попробуем воспроизвести результат
Выполняя несколько раз (потепление), у меня есть результаты (Core i7 3.6 GHz,.Net 4.6 IA-64):
Итак, вы не можете отклонить нулевую гипотезу о том, что ToLower работает быстрее, чем ToUpper , и, следовательно, ваш эксперимент получил ошибки:
- У вас есть разные строки для обработки
- Обработка коротких (только 175 символов) строка только один раз (не в цикле) должна быть мгновенной и, следовательно, ошибки могут быть чрезмерными
- Вам нужно разогреть рутину (в том порядке, чтобы компилироваться, загружаться сборки, заполнять кеширование и т.д.).
Похоже (время, прошедшее более 1 секунды для очень простой операции), это правило № 3 (разогревание) поломки, которое разрушило эксперимент
Ваша внутренняя гипотеза ToUpper , которая быстрее, чем ToLower , имеет логическую ошибку.
Ваши конверсии чувствительны к культуре. Вы не выполняете порядковую операцию, вы выполняете операцию, зависящую от вашей текущей культуры (как возвращается CultureInfo.CurrentCulture ). Преобразование от нижнего регистра к верхнему регистру может быть быстрее в используемой вами культуре, и это может быть медленнее в другом. Преобразование в одной культуре может быть также быстрее, чем преобразование в другой культуре.
Итак, ваше первоначальное предположение о том, что производительность одна для ToUpper и ToLower является ложным.
Коды ASCII символов
Этот список может помочь при использовании функций Asc и Chr . Таблица основана на ASCII Character Set
Управляющие символы (большинство непечатные; наиболее важные подсвечены жёлтым)
Символ (Обознач.) | Dec | Hex | Oct | Описание |
---|---|---|---|---|
NUL | 00 | 000 | Пустой символ | |
SOH | 1 | 01 | 001 | Начало заголовка, = console interrupt |
STX | 2 | 02 | 002 | Начало текста, maintenance mode on HP console |
ETX | 3 | 03 | 003 | Конец текста |
EOT | 4 | 04 | 004 | Конец передачи, не тоже самое, что ETB |
ENQ | 5 | 05 | 005 | Запрос, связан с ACK; old HP flow control |
ACK | 6 | 06 | 006 | Подтверждение, очищает ENQ logon hand |
BEL | 7 | 07 | 007 | Звуковой сигнал (Воспроизводит стандартный «бииип» системным динамиком ПК в Windows ) |
BS | 8 | 08 | 010 | Backspace, works on HP terminals/computers |
HT | 9 | 09 | 011 | Горизонтальная табуляция, перемещает к следующей позиции табуляции |
LF | 10 | 0a | 012 | Перенос строки |
VT | 11 | 0b | 013 | Вертикальная табуляция |
FF | 12 | 0c | 014 | Смена страницы, извлекает страницу |
CR | 13 | 0d | 015 | Возврат каретки |
SO | 14 | 0e | 016 | Shift Out, включает альтернативные символы |
SI | 15 | 0f | 017 | Shift In, возобновляет символы по умолчанию |
DLE | 16 | 10 | 020 | Экранирует управляющий символ |
DC1 | 17 | 11 | 021 | XON, with XOFF to pause listings; «:okay to send». |
DC2 | 18 | 12 | 022 | Управление устройством, код 2, block-mode flow control |
DC3 | 19 | 13 | 023 | XOFF, with XON is TERM=18 flow control |
DC4 | 20 | 14 | 024 | Управление устройством, код 4 |
NAK | 21 | 15 | 025 | Отрицательное подтверждение |
SYN | 22 | 16 | 026 | Пустой символ для синхронного режима передачи |
ETB | 23 | 17 | 027 | Конец передаваемого блока данных, не тоже самое, что EOT |
CAN | 24 | 18 | 030 | Отмена строки, MPE echoes . |
EM | 25 | 19 | 031 | Конец носителя, Control-Y interrupt |
SUB | 26 | 1a | 032 | Замена |
ESC | 27 | 1b | 033 | Экранирует, следующий символ не отображается |
FS | 28 | 1c | 034 | Разделитель файлов |
GS | 29 | 1d | 035 | Разделитель групп |
RS | 30 | 1e | 036 | Разделитель записей, block-mode terminator |
US | 31 | 1f | 037 | Разделитель полей |
DEL | 127 | 7f | 177 | Delete (rubout), cross-hatch box |
Печатные символы (стандартные)
Символ | Dec | Hex | Oct | Описание |
---|---|---|---|---|
32 | 20 | 040 | Пробел | |
! | 33 | 21 | 041 | Восклицательный знак |
« | 34 | 22 | 042 | Кавычка (» в HTML) |
# | 35 | 23 | 043 | Решётка (знак числа) |
$ | 36 | 24 | 044 | Доллар |
% | 37 | 25 | 045 | Проценты |
& | 38 | 26 | 046 | Амперсанд |
‘ | 39 | 27 | 047 | Закрывающая одиночная кавычка (апостроф) |
( | 40 | 28 | 050 | Открывающая скобка |
) | 41 | 29 | 051 | Закрывающая скобка |
* | 42 | 2a | 052 | Звёздочка, умножение |
+ | 43 | 2b | 053 | Плюс |
, | 44 | 2c | 054 | Запятая |
— | 45 | 2d | 055 | Дефис, минус |
. | 46 | 2e | 056 | Точка |
/ | 47 | 2f | 057 | Наклонная черта (слеш, деление) |
48 | 30 | 060 | Ноль | |
1 | 49 | 31 | 061 | Один |
2 | 50 | 32 | 062 | Два |
3 | 51 | 33 | 063 | Три |
4 | 52 | 34 | 064 | Четыре |
5 | 53 | 35 | 065 | Пять |
6 | 54 | 36 | 066 | Шесть |
7 | 55 | 37 | 067 | Семь |
8 | 56 | 38 | 070 | Восемь |
9 | 57 | 39 | 071 | Девять |
: | 58 | 3a | 072 | Двоеточие |
; | 59 | 3b | 073 | Точка с запятой |
62 | 3e | 076 | Знак больше | |
? | 63 | 3f | 077 | Знак вопроса |
@ | 64 | 40 | 100 | эт, собака |
A | 65 | 41 | 101 | Заглавная A |
B | 66 | 42 | 102 | Заглавная B |
C | 67 | 43 | 103 | Заглавная C |
D | 68 | 44 | 104 | Заглавная D |
E | 69 | 45 | 105 | Заглавная E |
F | 70 | 46 | 106 | Заглавная F |
G | 71 | 47 | 107 | Заглавная G |
H | 72 | 48 | 110 | Заглавная H |
I | 73 | 49 | 111 | Заглавная I |
J | 74 | 4a | 112 | Заглавная J |
K | 75 | 4b | 113 | Заглавная K |
L | 76 | 4c | 114 | Заглавная L |
M | 77 | 4d | 115 | Заглавная M |
N | 78 | 4e | 116 | Заглавная N |
O | 79 | 4f | 117 | Заглавная O |
P | 80 | 50 | 120 | Заглавная P |
Q | 81 | 51 | 121 | Заглавная Q |
R | 82 | 52 | 122 | Заглавная R |
S | 83 | 53 | 123 | Заглавная S |
T | 84 | 54 | 124 | Заглавная T |
U | 85 | 55 | 125 | Заглавная U |
V | 86 | 56 | 126 | Заглавная V |
W | 87 | 57 | 127 | Заглавная W |
X | 88 | 58 | 130 | Заглавная X |
Y | 89 | 59 | 131 | Заглавная Y |
Z | 90 | 5a | 132 | Заглавная Z |
[ | 91 | 5b | 133 | Открывающая квадратная скобка |
\ | 92 | 5c | 134 | Обратная наклонная черта (обратный слеш) |
] | 93 | 5d | 135 | Закрывающая квадратная скобка |
^ | 94 | 5e | 136 | Циркумфлекс, возведение в степень, знак вставки |
_ | 95 | 5f | 137 | Нижнее подчёркивание |
` | 96 | 60 | 140 | Открывающая одиночная кавычка, гравис, знак ударения |
a | 97 | 61 | 141 | Строчная a |
b | 98 | 62 | 142 | Строчная b |
c | 99 | 63 | 143 | Строчная c |
d | 100 | 64 | 144 | Строчная d |
e | 101 | 65 | 145 | Строчная e |
f | 102 | 66 | 146 | Строчная f |
g | 103 | 67 | 147 | Строчная g |
h | 104 | 68 | 150 | Строчная h |
i | 105 | 69 | 151 | Строчная i |
j | 106 | 6a | 152 | Строчная j |
k | 107 | 6b | 153 | Строчная k |
l | 108 | 6c | 154 | Строчная l |
m | 109 | 6d | 155 | Строчная m |
n | 110 | 6e | 156 | Строчная n |
o | 111 | 6f | 157 | Строчная o |
p | 112 | 70 | 160 | Строчная p |
q | 113 | 71 | 161 | Строчная q |
r | 114 | 72 | 162 | Строчная r |
s | 115 | 73 | 163 | Строчная s |
t | 116 | 74 | 164 | Строчная t |
u | 117 | 75 | 165 | Строчная u |
v | 118 | 76 | 166 | Строчная v |
w | 119 | 77 | 167 | Строчная w |
x | 120 | 78 | 170 | Строчная x |
y | 121 | 79 | 171 | Строчная y |
z | 122 | 7a | 172 | Строчная z |
< | 123 | 7b | 173 | Открывающая фигурная скобка |
| | 124 | 7c | 174 | Вертикальная черта |
> | 125 | 7d | 175 | Закрывающая фигурная скобка |
126 | 7e | 176 | Тильда (приблизительно) |
Расширенный набор символов (ANSI) в русской кодировке Win-1251