summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index 971a861..e5c7ef6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,7 @@
# include <locale.h>
# include <luma/arch.h>
# include <luma/print.h>
+# include <luma/utf8dec.h>
# include <luma/utf8enc.h>
# include <stdint.h>
# include <stdio.h>
@@ -14,17 +15,12 @@ int main(void) {
for(size_t i = (size_t){0x0};i < sizeof code / sizeof code[0x0];++i) {
printf("Got code %d.\n",code[i]);
}
- uint8_t const * msg = luma_utf8enc((uint32_t[]){0x00A2,0x2C,0x939,0x2C,0x10348,0x2C,0x20Ac,0x2C,0x218A,0x2C,0x1F44B,0x0});
- printf("%s\n",msg);
- //uint32_t * utf = luma_utf8dec(msg);
+ uint8_t const * msg = luma_utf8enc((uint32_t[]){0x00A2,0x2C,0x939,0x2C,0x10348,0x2C,0x20AC,0x2C,0x218A,0x2C,0x1F44B,0x0},NULL);
+ printf("Array: %s\n",msg);
free((void *)msg);
- /*for(size_t n = (size_t){0x0};;n += (size_t){0x1}) {
- if(utf[n] == (uint32_t){0x0}) {
- break;
- }
- printf("%d\n",utf[n]);
- }
- free((void *)utf);*/
- //luma_print("Hello world. �👋");
+ uint32_t * codeps = luma_utf8dec(luma_utf8enc((uint32_t[]){0x1F44B,0x0},NULL),NULL);
+ printf("It is %u.\n",codeps[0x0]);
+ luma_print((uint32_t[]){0x48,0x65,0x6C,0x6C,0x6F,0x20,0xFFFD,0x65,0x72,0x65,0x21,0x0},(uint32_t){0xF0});
+ free((void *)codeps);
exit(EXIT_SUCCESS);
}