Skip to content

Instantly share code, notes, and snippets.

@leanderbes
leanderbes / unicode-names.h
Last active May 23, 2021 18:45
Array with Unicode Character Names
View unicode-names.h
This file has been truncated, but you can view the full file.
// Data from https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
const char *UnicodeNames[] = {
[0x0000]="NULL",
[0x0001]="START OF HEADING",
[0x0002]="START OF TEXT",
[0x0003]="END OF TEXT",
[0x0004]="END OF TRANSMISSION",
[0x0005]="ENQUIRY",
[0x0006]="ACKNOWLEDGE",
[0x0007]="BELL",
@leanderbes
leanderbes / unicode-enum.h
Last active May 23, 2021 18:10
C++ enum with unicode names
View unicode-enum.h
/* C++ enum of unicode character names.
*
* Because of the limits of C++ identifiers the following characters have been remapped:
* " " -> "_"
* "-" -> "_"
* "'" -> ""
* """ -> ""
* "." -> ""
* "+" -> "_"
* "/" -> "_"
@leanderbes
leanderbes / quine.c
Last active January 28, 2021 00:03
Quine
View quine.c
#include<stdio.h>
void main(){char*s="#include<stdio.h>%cvoid main(){char*s=%c%s%c;printf(s,10,34,s,34);}";printf(s,10,34,s,34);}