Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:07:43+00:00 2026-05-14T07:07:43+00:00

I am trying to use Unicode variable names in g++, but it does not

  • 0

I am trying to use Unicode variable names in g++, but it does not appear to work.

Does g++ not support Unicode variable names? Or is there some subset of Unicode (from which I’m not testing in)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:07:44+00:00Added an answer on May 14, 2026 at 7:07 am

    You have to specify the -fextended-identifiers flag when compiling. You also have to use \uXXXX or \uXXXXXXXX for Unicode (at least in GCC, it’s Unicode).

    Identifiers (variable/class names, etc.) in g++ can’t be of UTF-8/UTF-16 or whatever encoding. They have to be:

    identifier:
      nondigit
      identifier nondigit
      identifier digit
    

    A nondigit is

    nondigit: one of
      universalcharactername
      _ a b c d e f g h i j k l m n o p q r s t u v w x y z
      A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    

    And a universalcharactername is

    universalcharactername:
      \UXXXXXXXX
      \uXXXX
    

    Thus, if you save your source file as UTF-8, you cannot have a variable like:

    int høyde = 10;
    

    It had to be written like:

    int h\u00F8yde = 10;
    

    (which, in my opinion, would defeat the purpose. So just stick with a-z)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use ReportLab with Unicode characters, but it is not working.
I'm trying to figure out how to use the unicode support in python; I
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I've been trying to use the cpw library for some graphics things. I got
I am trying do string formatting with a unicode variable. For example: >>> x
I'm trying to use urllib and urllib2 to read from a text file that
I'm having some trouble getting unicode to work for git-bash (on windows 7). I
I am trying to use perl's YAML::XS module on unicode letters and it doesn't
Im trying to use BCP to dump data from CDC function into a .dat
i'm trying to use the Widcomm bluetooth stack by Broadcomm and it should work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.