Questions tagged [char32-t]

The C++11 `char32_t` standard type represents a character in UTF-32 encoding.

15 questions
36
votes
4 answers

Visual Studio C++ 2015 std::codecvt with char16_t or char32_t

This code compiled OK under VS2013: std::string Unicode::utf16_to_utf8(std::u16string utf16_string) { std::wstring_convert, char16_t> convert; return convert.to_bytes(utf16_string); } Now with VS2015 I…
user3443139
  • 654
  • 1
  • 7
  • 11
26
votes
1 answer

Using char16_t and char32_t in I/O

C++11 introduces char16_t and char32_t to facilitate working with UTF-16- and UTF-32-encoded text strings. But the library still only supports the implementation-defined wchar_t for multi-byte I/O. Why has support for char16_t and…
oz1cz
  • 5,504
  • 6
  • 38
  • 58
25
votes
1 answer

New unicode characters in C++0x

I'm buiding an API that allows me to fetch strings in various encodings, including utf8, utf16, utf32 and wchar_t (that may be utf32 or utf16 according to OS). New C++ standard had introduced new types char16_t and char32_t that do not have this…
Artyom
  • 31,019
  • 21
  • 127
  • 215
15
votes
1 answer

Is a naked char32_t signed or unsigned?

Similarly, is a naked char16_t signed or unsigned? Is it implementation defined?
Samuel Edwin Ward
  • 6,526
  • 3
  • 34
  • 62
12
votes
3 answers

C++ What does the size of char16_t depend on?

This is also related to char32_t and any intXX_t. The specification points out that: 2.14.3.2: The value of a char16_t literal containing a single c-char is equal to its ISO 10646 code point value, provided that the code point is …
0xbadf00d
  • 17,405
  • 15
  • 67
  • 107
4
votes
2 answers

is equivalents for char32_t

Are there any equivalents for the char functions (ispace, isalpha, etc) defined in for char32_t? I had a look around & could only see iswspace (& related) which seem like those are for 16bit chars. Note: while isspace takes a int as a…
user3818491
  • 498
  • 1
  • 6
  • 16
3
votes
3 answers

char16_t and char32_t endianness

In C11, support for portable wide char types char16_t and char32_t are added for UTF-16 and UTF-32 respectively. However, in the technical report, there is no mention of endianness for these two types. For example, the following snippet in gcc-4.8.4…
Ryan Li
  • 9,020
  • 7
  • 33
  • 62
3
votes
0 answers

Xcode 6 beta 5: compile error of "Use of undeclared identifier 'char32_t'" when change the deployment target to 7.0

I used both OC and Swift in my current project. The mixed code works fine in Xcode 6 beta. Currently, when I update Xcode 6 beta to beta 5. Then I came across many compile errors most of which are mainly caused by the new features of Swift language…
fengtao.ft
  • 81
  • 5
1
vote
1 answer

Invalid uninitialized jump or move memory error while trying to split a char32_t string into tokens manually

I am trying to split a char32_t string into tokens separated by a delimiter. I am not using any strtok or other std library function because, it is gurrented that input string and the delimiter will be mulltibyte unicode string. Here is the function…
polu_
  • 342
  • 7
  • 17
1
vote
2 answers

How to handle char16_t or char32_t with printf and scanf in C?

If I write: char a = 'A'; printf("%x %c", a, a); it will produce the output "41 A". Similary when I write char32_t c = U''; printf("%x %c", c, c); //even tried %lc and %llc it will produce the output "1f34c L" instead of expected "1f34c "! Is…
Sourav Kannantha B
  • 2,860
  • 1
  • 11
  • 35
1
vote
0 answers

How to test if a unicode character (char32_t) is in upper case in C++

Is there an isupper for char32_t? I get an assertion fail on the following code line assert(isupper(U'Å'));
ragnarius
  • 5,642
  • 10
  • 47
  • 68
0
votes
0 answers

What is the relation between char ~ char32_t type and UTF-8 ~ UTF-32?

char: 8-bit character type char16_t: 16-bit character type char32_t: 32-bit character type wchar_t: 16 ~ 32-bit character type depending on the compiler   UTF-8: An encoding method that can represent Unicode characters while preserving 8-bit…
user3818260
0
votes
2 answers

Any way to create a char of size 32 in ANSI c?

I know C++11 has a type char32_t that is 4 bytes, and I'm wondering if it's possible to implement something similar in C. The program I'm writing needs to have all char arrays be a multiple of 4 bytes.
0
votes
2 answers

How to convert std::string to std::u32string?

Is there an easy STL way to convert a std::string to a std::u32string, i.e. a basic_string of char to char32_t? This is not a Unicode question.
user3443139
  • 654
  • 1
  • 7
  • 11
0
votes
0 answers

C++: fixed-size integer implementation for charX_t types

It is known to me that new character types were introduced in C++11. However, since C++11 is not available everywhere, it may be necessary to introduce char16_t and char32_t for everyone who wishes to work with UTF-16 and UTF-32. I've tried to…
ghostmansd
  • 3,285
  • 5
  • 30
  • 44