powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / C++ [игнор отключен] [закрыт для гостей] / что выбрать CString или string ??
1 сообщений из 26, страница 2 из 2
что выбрать CString или string ??
    #34851526
ErV
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
grieg wrote:

> Не понял, что именно ты спрашиваешь?
> Будут ли у QString (Qt) проблемы с кодировками?
Я не спрашиваю, я предлагаю.

The QString class provides a Unicode character string.
QString stores a string of 16-bit QChars, where each QChar corresponds
one Unicode 4.0 character. (Unicode characters with code values above
65535 are stored using surrogate pairs, i.e., two consecutive QChars.)
Unicode is an international standard that supports most of the writing
systems in use today. It is a superset of ASCII and Latin-1 (ISO
8859-1), and all the ASCII/Latin-1 characters are available at the same
code positions.
Behind the scenes, QString uses implicit sharing (copy-on-write) to
reduce memory usage and to avoid the needless copying of data. This
also helps reduce the inherent overhead of storing 16-bit characters
instead of 8-bit characters.

Насчет кодировок - есть кодеки для конвертирования текста, я с ними
обильно не общался. Как я понимаю, вас интересуют:

int compare ( const QLatin1String & s1, const QString & s2,
Qt::CaseSensitivity cs = Qt::CaseSensitive )
QString fromAscii ( const char * str, int size = -1 )
QString fromLatin1 ( const char * str, int size = -1 )
QString fromLocal8Bit ( const char * str, int size = -1 )
QString fromRawData ( const QChar * unicode, int size )
QString fromStdString ( const std::string & str )
QString fromStdWString ( const std::wstring & str )
QString fromUcs4 ( const uint * unicode, int size = -1 )
QString fromUtf8 ( const char * str, int size = -1 )
QString fromUtf16 ( const ushort * unicode, int size = -1 )
QString fromWCharArray ( const wchar_t * string, int size = -1 )

Примеры для работы с кодировками были где-то в демках.
Posted via ActualForum NNTP Server 1.4
...
Рейтинг: 0 / 0
1 сообщений из 26, страница 2 из 2
Форумы / C++ [игнор отключен] [закрыт для гостей] / что выбрать CString или string ??
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]