Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] How to type or handle non-unicode characters

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
larienna
Posts: 107
Joined: 2014-09-27 20:54

[Solved] How to type or handle non-unicode characters

#1 Post by larienna »

I am currently making a program that will use the ISO/IEC 8859-15 character set. The main reason is because the font needs to be hand drawn as a bitmap font due to the limited size, therefore, I don't want to draw 16000 characters for each font by hand. The ISO/IEC 8859-15 character set should support all European languages:

https://en.wikipedia.org/wiki/ISO/IEC_8859-15

Now the problem is that when I am in a text editor or in Code::Blocks, if I type an accented character like é è à, it actually insert a Unicode character in the text. The main consequence is that my program will display 2 wacky characters instead of the right character, since Unicode use 2 bytes.

I want to be able to type ISO/IEC 8859-15 characters while programming and when editing text files. How can it be done?

If there is absolutely no way to avoid this, is there a way to dodge those Unicode characters programmatically. For example, if I detect a certain value in a byte, I skip it and read the next one.
Last edited by larienna on 2024-04-07 03:44, edited 1 time in total.

Aki
Global Moderator
Global Moderator
Posts: 2979
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 75 times
Been thanked: 407 times

Re: How to type or handle non-unicode characters

#2 Post by Aki »

Hello,
larienna wrote: 2024-02-12 12:47 [..]
I want to be able to type ISO/IEC 8859-15 characters while programming and when editing text files. How can it be done?
[..]
You can set up the locale and its character encoding in your preferred code editor.

For example, this is the Kate editor (from the KDE project):
Screenshot_20240213_060803-kat-locales.png
Replacing "Unicode [..]" with "8859-15" in the "Encoding" field should allow you to write programs in ISO/IEC 8859-15 character encoding.

Hope this helps.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

larienna
Posts: 107
Joined: 2014-09-27 20:54

Re: How to type or handle non-unicode characters

#3 Post by larienna »

I managed to changed the encoding in Code::Blocks after a lot of experimentation. This was my primary objective.

I am currently using Pluma as my main text editor and there does not seems to be any way to change the encoding. Even the Mate desktop environment does not seems to have any options to change the encoding.

I guess I have to change the encoding for each application that will modifies my data.

Thanks

Aki
Global Moderator
Global Moderator
Posts: 2979
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 75 times
Been thanked: 407 times

Re: How to type or handle non-unicode characters

#4 Post by Aki »

Hello,
larienna wrote: 2024-02-13 11:18 I managed to changed the encoding in Code::Blocks after a lot of experimentation. This was my primary objective.
I'm glad you sorted it out. :)

Please, mark the discussion as "solved" manually adding the text tag "[Solved]" at the beginning of the subject of the first message (after other tags, if any) adding a reference to ISO/IEC 8859-15 character encoding; for example:
[Solved] How to type or handle non-unicode characters (ISO/IEC 8859-15)
It would be better to open a new discussion for the next topic:
larienna wrote: 2024-02-13 11:18 I am currently using Pluma as my main text editor and there does not seems to be any way to change the encoding [to ISO/IEC 8859-15]. Even the Mate desktop environment does not seems to have any options to change the encoding. I guess I have to change the encoding for each application that will modifies my data.
Yes, it was supported in the past, therefore it should be possible to support it a system level. You could try installing and configure the locales-all package that supply the following 8859-15 locales:

Code: Select all

$ apt-file list locales-all | grep '885915' | grep 'LC_CTYPE'
locales-all: /usr/lib/locale/en_DK.iso885915/LC_CTYPE
locales-all: /usr/lib/locale/en_GB.iso885915/LC_CTYPE
locales-all: /usr/lib/locale/en_US.iso885915/LC_CTYPE
locales-all: /usr/lib/locale/et_EE.iso885915/LC_CTYPE
locales-all: /usr/lib/locale/sv_SE.iso885915/LC_CTYPE
Then you can configure the default locale system to one of these locales with (root password is required):

Code: Select all

su -l -c "dpkg-reconfigure locales"
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply