Skip to content

Commit

Permalink
Avoid astral plane charaters on some systems
Browse files Browse the repository at this point in the history
  • Loading branch information
Justine Tunney committed Jan 8, 2023
1 parent 84d4b73 commit 1bb8175
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
1 change: 0 additions & 1 deletion blink/blinkenlights.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include "blink/stats.h"
#include "blink/strwidth.h"
#include "blink/syscall.h"
#include "blink/termios.h"
#include "blink/thompike.h"
#include "blink/timespec.h"
#include "blink/tsan.h"
Expand Down
18 changes: 17 additions & 1 deletion blink/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
β•šβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€*/
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -29,7 +30,6 @@
#include "blink/endian.h"
#include "blink/macros.h"
#include "blink/pty.h"
#include "blink/termios.h"
#include "blink/thompike.h"
#include "blink/util.h"

Expand Down Expand Up @@ -234,7 +234,11 @@ static wchar_t *GetXlatItalic(void) {
static bool once;
static wchar_t xlat[128];
if (!once) {
#if WCHAR_MAX > 0x10000
XlatAlphabet(xlat, L'π‘Ž', L'𝐴');
#else
XlatAlphabet(xlat, L'a', L'A');
#endif
once = true;
}
return xlat;
Expand All @@ -244,7 +248,11 @@ static wchar_t *GetXlatBoldItalic(void) {
static bool once;
static wchar_t xlat[128];
if (!once) {
#if WCHAR_MAX > 0x10000
XlatAlphabet(xlat, L'𝒂', L'𝑨');
#else
XlatAlphabet(xlat, L'a', L'A');
#endif
once = true;
}
return xlat;
Expand All @@ -254,7 +262,11 @@ static wchar_t *GetXlatBoldFraktur(void) {
static bool once;
static wchar_t xlat[128];
if (!once) {
#if WCHAR_MAX > 0x10000
XlatAlphabet(xlat, L'𝖆', L'𝕬');
#else
XlatAlphabet(xlat, L'a', L'A');
#endif
once = true;
}
return xlat;
Expand All @@ -265,6 +277,7 @@ static wchar_t *GetXlatFraktur(void) {
static bool once;
static wchar_t xlat[128];
if (!once) {
#if WCHAR_MAX > 0x10000
for (i = 0; i < ARRAYLEN(xlat); ++i) {
if ('A' <= i && i <= 'Z') {
xlat[i] = L"π”„π”…β„­π”‡π”ˆπ”‰π”Šβ„Œβ„‘π”π”Žπ”π”π”‘π”’π”“π””β„œπ”–π”—π”˜π”™π”šπ”›π”œβ„¨"[i - 'A'];
Expand All @@ -274,6 +287,9 @@ static wchar_t *GetXlatFraktur(void) {
xlat[i] = i;
}
}
#else
XlatAlphabet(xlat, L'a', L'A');
#endif
once = true;
}
return xlat;
Expand Down
18 changes: 0 additions & 18 deletions blink/termios.h

This file was deleted.

2 changes: 1 addition & 1 deletion blink/xlat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <termios.h>

#include "blink/linux.h"
#include "blink/termios.h"

int UnXlatOpenFlags(int);
int UnXlatAccMode(int);
Expand Down

0 comments on commit 1bb8175

Please sign in to comment.