From 5be431b49e44e3aaa14f9f8003d502f6a1894264 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 28 Oct 2020 12:43:36 +0100 Subject: Fixed UTF-8 running --- run | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/run b/run index 0d704b3..ba49d6a 100755 --- a/run +++ b/run @@ -1,3 +1,14 @@ #!/usr/bin/env sh -gcc -Wall -Wextra -pedantic-errors -std=c99 main.c && ./a.out && rm a.out +rm -rf build/ && mkdir -p build/ + +convert() { + cat $1 | perl -pe 'BEGIN { binmode STDIN, ":utf8"; } s/(.)/ord($1) < 128 ? $1 : sprintf("\\U%08x", ord($1))/ge;' > build/$1 +} + +convert main.c +convert macros.h + +cd build/ || exit 1 +gcc -Wall -Wextra -pedantic-errors -std=c11 main.c && ./a.out && rm a.out +cd ../ && rm -rf build/ -- cgit v1.2.3