summaryrefslogtreecommitdiffhomepage
path: root/include/stc/utf8.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-03-16 21:41:40 +0100
committerTyge Løvset <[email protected]>2022-03-16 21:41:40 +0100
commit0468971b404cee5582d360d7d1c66bb4148e1614 (patch)
tree9161ccbea490a5dab70e641f7bd568521a5da636 /include/stc/utf8.h
parent342484f70998258022c26e6af2926ecc7635bbdd (diff)
downloadSTC-modified-0468971b404cee5582d360d7d1c66bb4148e1614.tar.gz
STC-modified-0468971b404cee5582d360d7d1c66bb4148e1614.zip
Bugfix: carc and cbox cmp functions had bug.
Renamed: i_key_sptr / i_val_sptr to i_key_arcbox / i_val_arcbox. Other smaller updates.
Diffstat (limited to 'include/stc/utf8.h')
-rw-r--r--include/stc/utf8.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/stc/utf8.h b/include/stc/utf8.h
index 60599519..0a1ba161 100644
--- a/include/stc/utf8.h
+++ b/include/stc/utf8.h
@@ -9,17 +9,19 @@ int main()
{
c_auto (cstr, s1) {
s1 = cstr_new("hell😀 w😀rld");
- cstr_replace_sv(&s1, utf8_substr(s1.str, 7, 1), c_sv("x"));
+ printf("%s\n", s1.str);
+ cstr_replace_sv(&s1, utf8_substr(s1.str, 7, 1), c_sv("🐨"));
printf("%s\n", s1.str);
csview sv = csview_from_s(s1);
c_foreach (i, csview, sv)
- printf(c_PRIsv ",", c_ARGsv(i.cp));
+ printf(c_PRIsv ",", c_ARGsv(i.codep));
}
}
// Output:
-// hell😀 wxrld
-// h,e,l,l,😀, ,w,x,r,l,d,
+// hell😀 w😀rld
+// hell😀 w🐨rld
+// h,e,l,l,😀, ,w,🐨,r,l,d,
*/
#include "ccommon.h"
#include <ctype.h>