Link to home
Create AccountLog in
C++

C++

--

Questions

--

Followers

Top Experts

Avatar of KaranGupta
KaranGupta

unicode of solid square bullet
Hi

What is the unicode of square solid bullet

(like the unicode of round solid bullet is \u2022)

Regards
Karan

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of alb66alb66🇮🇹


Avatar of alb66alb66🇮🇹


Avatar of KaranGuptaKaranGupta

ASKER

Hi

Thanks for the quick reply

I am using this code

const TCHAR* bullet = _T("\u25A0");
text = ConvertToCharString(bullet);

But this code is not giving me the bullet output I want.

Regards
Karan

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of itsmeandnobodyelseitsmeandnobodyelse🇩🇪

>>>> text = ConvertToCharString(bullet);

I didn't find the ConvertToCharString in my environment. For the bullet to show you would need a function which converts UTF-8 to wide char string and have a 'print' functions which takes wide char strings and uses a UNICODE font for output.

You could look whether the ConvertToCharString actually is a UTF-8 to Wide-String converter (where I have doubts) but maybe easier is to skip the conversion and simply have

  wchar_t bullet[2] = { 0x25A0, 0x0000 };

and print the bullet using a suitable UNICODE print function.



ASKER CERTIFIED SOLUTION
Avatar of alb66alb66🇮🇹

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of itsmeandnobodyelseitsmeandnobodyelse🇩🇪

>>>> GetDlgItem( IDC_STATIC1 )->SetWindowText( L"Hello unicode \u2022 \u25A0" );

As told above: the usage of "\u2022" or "\u25A0" requires an output function which was able to interpret the UTF-8 or UTF-16 sequences starting with \u.

That is *not* the normal way UNICODE characters were stored in a wide char string, as the L"\u25A0" needs 6 characters (or 12 bytes in case of using wide char strings) to define the UNICODE character 0x25A0 which could be stored in *one* single wide character as well:

 GetDlgItem( IDC_STATIC1 )->SetWindowText( CString(L"Hello unicode ") + WCHAR(0x25A0) + CString(L" ") + WCHAR(0x25A0) );




Avatar of alb66alb66🇮🇹

>>>>> requires an output function which was able to interpret the UTF-8 or UTF-16 sequences starting with \u.

I think it is resolved at compile time


>>>>> the L"\u25A0" needs 6 characters

It compiles in one single wide character:

      WCHAR buf[10];
      wcscpy_s( buf, L"\u25A0" );
      ASSERT( wcslen( buf ) == 1 );

In memory you have the following values (1 wide char + 1 terminator):
a0 25 00 00

See the attached image

Debug.JPG

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.

C++

C++

--

Questions

--

Followers

Top Experts

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.