Added code to handle appending multiple characters.

This commit is contained in:
2022-06-30 22:09:30 -05:00
parent d4331290e5
commit 3564c43ff4
3 changed files with 41 additions and 7 deletions
+8 -7
View File
@@ -23,8 +23,8 @@
// const unsigned char Four = 0xF7;
int main(int argc, char** argv) {
char glyph[10] = { 0 };
char characters[8] = { 0 };
char glyph[8] = { 0 };
char characters[8] = { 42 };
int index = 2;
TString* string = TStringCreate();
@@ -33,18 +33,19 @@ int main(int argc, char** argv) {
char* test2 = u8"\xE3\x81\x84";
char* test4 = u8"\xF0\xA0\xBA\x8C";
char* test5 = "B";
char* test3 = " Just some\0 extra text";
char* test3 = " Just some extra text";
TStringAppendText(test, string);
TStringAppendText(test2, string);
TStringAppendText(test4, string);
TStringAppendText(test5, string);
TStringAppendText(test3, string);
//GetCharByIndex(index, characters, string);
//GetCharByIndex(3, glyph, string);
TStringGetGlyph(index, characters, string);
TStringGetGlyph(3, glyph, string);
// printf("From string index %d: '%s' (string length is %d)\n", index, characters, string->Length);
// printf("And one English character: '%s'\n", glyph);
printf("From string index %d: '%s' (string length is %d)\n", index, characters, TStringLength(string));
printf("And one English character: '%s'\n", glyph);
printf("Full string: '%s'\n", TStringGetString(string));
//fgets(glyph, 10, stdin);