Home > Backend Development > C++ > Can g Handle Unicode Characters in Identifiers?

Can g Handle Unicode Characters in Identifiers?

Patricia Arquette
Release: 2024-11-11 10:25:03
Original
918 people have browsed it

Can g   Handle Unicode Characters in Identifiers?

Unicode Characters in Identifiers: Support in g

Despite the availability of the -fextended-identifiers option, g versions up to 4.8 do not allow the use of characters outside the Basic Multilingual Plane (BMP) in identifiers. This includes characters such as the emoji ?.

The standard allows characters in the range 10000-1FFFD as part of identifiers, but g 's support is limited to a smaller set of characters defined in the ucnid.tab file.

The -fextended-identifiers option is experimental and has varying support across different g versions. Starting from version 4.9.0, g supports the C11 character set, which includes the U0001F603 emoji used in the second code example.

However, even in g 8.2, using the ? emoji in an identifier results in an error. This suggests that full support for Unicode characters in identifiers may not be available in all configurations.

Other compilers, such as Clang 3.3, provide better support for Unicode characters in identifiers. Both code examples provided work without any additional options when compiled with Clang using the -std=c 11 standard.

The above is the detailed content of Can g Handle Unicode Characters in Identifiers?. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template