ATARIST encoding for linux iconv
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
-
- Fuji Shaped Bastard
- Posts: 3270
- Joined: Sun Aug 03, 2014 5:54 pm
ATARIST encoding for linux iconv
Almost forgot this, but a few weeks ago i hacked together a gconv module for iconv. iconv is the tool on linux that can convert between lots of character encoding. However atarist (although present in the iconv source distribution) is usually not compiled in. Furthermore, on linux based system, the core of iconv is part of the glibc, so recompiling iconv yourself does not help. Luckily, the implementation in glibc uses gconv shared modules to load character sets on demand, and here is the one for atarist encoding. Instructions are contained in the archive. Maybe someone will find this useful.
PS.: the compiled module is for 64bit systems only.
PS.: the compiled module is for 64bit systems only.
You do not have the required permissions to view the files attached to this post.
Re: ATARIST encoding for linux iconv
As an additional hint that might not be obvious to everybody (that I, personally, find extremly useful, however): when cross compiling, this can be used to convert strings during compilation.
m68k-atari-mint-gcc has the option "-fexec-charset" that allows you to translate compiled string constants written in the default charset of your host (e.g. UTF8, standard on Linux) into the Atari target charset on the fly.
I.e., if you have a .c file with string constants
written in UTF8, characters will be automatically converted into the Atari charset with the option "-fexec-charset=ATARI". On the Atari, "magically", the correct "special characters" will appear at runtime. This option makes use of Thorsten's iconv module.
No more fiddling with hex constants in strings, no accidents with git or modern editors anymore. Thanks, Thorsten!
m68k-atari-mint-gcc has the option "-fexec-charset" that allows you to translate compiled string constants written in the default charset of your host (e.g. UTF8, standard on Linux) into the Atari target charset on the fly.
I.e., if you have a .c file with string constants
Code: Select all
const char str[] = "characters: äöüß";
No more fiddling with hex constants in strings, no accidents with git or modern editors anymore. Thanks, Thorsten!
Re: ATARIST encoding for linux iconv
Works like a charm but in Linux Mint 20.2 and Debian 10 i had to copy it to /usr/lib/x86_64-linux-gnu/gconv/ to get it to work. There is also the gconv-modules
• FireBee • Falcon030/040/060 • MiSTer • TT • (Mega)STe • Suska III-B • Suska III-C • (Mega)ST •
-
- Fuji Shaped Bastard
- Posts: 3270
- Joined: Sun Aug 03, 2014 5:54 pm
Re: ATARIST encoding for linux iconv
Yes, sorry, other distributions might have different directories where the modules are stored. If in doubt, just do a
Edit: forgot to mention: that file is most likely been overwritten if glibc is updated, so you may have to redo the install steps after that,
Code: Select all
$ sudo find /usr -name gconv-modules
Re: ATARIST encoding for linux iconv
in best cases, apt will ask you if it is okay to overwrite the changes
• FireBee • Falcon030/040/060 • MiSTer • TT • (Mega)STe • Suska III-B • Suska III-C • (Mega)ST •
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 3838
- Joined: Sun Jul 31, 2011 1:11 pm
Re: ATARIST encoding for linux iconv
Thanks, this is really useful!mfro wrote: ↑Mon Jul 19, 2021 12:57 pm I.e., if you have a .c file with string constants written in UTF8, characters will be automatically converted into the Atari charset with the option "-fexec-charset=ATARI". On the Atari, "magically", the correct "special characters" will appear at runtime. This option makes use of Thorsten's iconv module.
- alexh
- Fuji Shaped Bastard
- Posts: 3084
- Joined: Wed Oct 20, 2004 1:52 pm
- Location: UK - Oxford
- Contact:
Re: ATARIST encoding for linux iconv
Thanks. This was used to convert the Amberstar source code that was released yesterday
Re: ATARIST encoding for linux iconv
alexh: I've just seen the repo (https://github.com/jhorneman/amberstar), that's awesome..
Re: ATARIST encoding for linux iconv
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
-
- Fuji Shaped Bastard
- Posts: 3270
- Joined: Sun Aug 03, 2014 5:54 pm
Re: ATARIST encoding for linux iconv
You should better make an announcement for this. People searching info about amberstar/ambermoon will certainly not look into a thread talking about iconv
Re: ATARIST encoding for linux iconv
it was announced today. I have seen a someone post here on AF , but now I'm not able to find it. Maybe it was removed/deleted.ThorstenOtto wrote: ↑Tue May 09, 2023 12:53 pm You should better make an announcement for this. People searching info about amberstar/ambermoon will certainly not look into a thread talking about iconv
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org