Mercurial > web
comparison _posts/2024-06-09-schism-unicode-and-you.html @ 87:60f77a3de847
css: improve appearance on mobile
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 11 Jun 2024 00:50:07 -0400 |
parents | 1fed81c848a5 |
children |
comparison
equal
deleted
inserted
replaced
86:1fed81c848a5 | 87:60f77a3de847 |
---|---|
5 nowplaying: 'Holy Fuck - LP' | 5 nowplaying: 'Holy Fuck - LP' |
6 --- | 6 --- |
7 <span>Recently I've taken on adding real Unicode-awareness to Schism, and it was <i>surprisingly</i> easy, to say the least.</span> | 7 <span>Recently I've taken on adding real Unicode-awareness to Schism, and it was <i>surprisingly</i> easy, to say the least.</span> |
8 <br><br> | 8 <br><br> |
9 <span>I was expecting to have to convert lots of things to be real Unicode, but nope! All that really needed to be done was to convert UTF-8 to CP437 where necessary to actually *draw* the data while keeping the internal form pure UTF-8, and then bundle everything up into a neat macro to keep everything consistent:</span> | 9 <span>I was expecting to have to convert lots of things to be real Unicode, but nope! All that really needed to be done was to convert UTF-8 to CP437 where necessary to actually *draw* the data while keeping the internal form pure UTF-8, and then bundle everything up into a neat macro to keep everything consistent:</span> |
10 <figure><pre><code>#define CHARSET_EASY_MODE_EX(MOD, in, inset, outset, x) \ | 10 <figure><pre class="code-block"><code>#define CHARSET_EASY_MODE_EX(MOD, in, inset, outset, x) \ |
11 do { \ | 11 do { \ |
12 MOD uint8_t* out; \ | 12 MOD uint8_t* out; \ |
13 charset_error_t err = charset_iconv(in, (uint8_t**)&out, inset, outset); \ | 13 charset_error_t err = charset_iconv(in, (uint8_t**)&out, inset, outset); \ |
14 if (err) \ | 14 if (err) \ |
15 out = in; \ | 15 out = in; \ |