Author Topic: How to use CB (Windows or Linux) with Unicode and Wide characters  (Read 3098 times)

Offline stbradley

  • Single posting newcomer
  • *
  • Posts: 4
Greetings,

I have occasionally wanted to create a Terminal program that uses Greek letters, superscript and subscript numbers and some scientific symbols.  I found that this can easily be done using Unicode.  Additionally, C and C++ handle Unicode as wide characters (wchar_t) and have many functions available for handling them.  So, naively, I thought this would easily solve my problem and I could write my program.  But I'm not so lucky.  And thus began the 2020 Console Video project (COVID-20).  (2020 because I started working on it in 2020).  ;D

As anyone who has tried to use Unicode or wide characters will soon discover your Terminal will not display Unicode or wide characters correctly.  It turns out that not only does displaying these characters properly depend on what OS you are using, it depends on what compiler you use.  So I have created the single header "unicoder.h" that hides the dirty work from you by figuring out what OS (Windows or Linux) and compiler (Code::Blocks, see listing included in documentation of other compilers) you are using and then setting things up so that you can display wide characters and Unicode easily.  It also includes many definitions of Unicode characters for your convenience.
 
I have also added some features to Unicoder that let you turn on/off underline, bold fonts and color font/background.

On the off chance someone might be interested in using Unicode or wide characters you can find Unicoder here: https://github.com/sthomasbradley/Unicoder

See Ya
S. Thomas Bradley
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7197
    • My Best Post
Re: How to use CB (Windows or Linux) with Unicode and Wide characters
« Reply #1 on: November 02, 2021, 05:34:33 pm »
Please learn how to use git correctly your use of a zip file in a git repo implies you are a newbie or a virus writer!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online AndrewCot

  • Regular
  • ***
  • Posts: 342
Re: How to use CB (Windows or Linux) with Unicode and Wide characters
« Reply #2 on: November 03, 2021, 01:25:32 am »
I would suggest grabbing a book on GIT from the internet and read up on how to use git correctly.

Once GIT book available on the internet is:
   https://git-scm.com/book/en/v2

There are others.

Offline stbradley

  • Single posting newcomer
  • *
  • Posts: 4
Re: How to use CB (Windows or Linux) with Unicode and Wide characters
« Reply #3 on: November 04, 2021, 04:58:30 pm »
Thank you for your input. 

I fixed this yesterday once I realized what I did.  And to be honest with you I have no interest in learning GIT and after more then 30 years of programming and am now eyeing retirement I have no plans in doing so now.   I only opted to use GitHub because it is by far the most popular site for uploading projects and therefore where the most people would find my project. 

I'm just trying to make something available to make things easier for others instead of monitoring forums so I can tell people I know stuff they don't and therefore I am smarter then they are.  This is why I have posted only 2 or 3 things on this forum in the last 15 years in have been a member here.