jeffbezanson / cutef8 Goto Github PK
View Code? Open in Web Editor NEWsimple, fast C routines for manipulating UTF-8
simple, fast C routines for manipulating UTF-8
Sorry I think this is my fork repository
Hi, I found this library and I like it since it's very compact.
Something that boggles my mind, with this test program:
#include <stdio.h> //printf
#include <stdlib.h> //malloc
#include <locale.h>
#include "utf8.h"
//gcc -o testutf8 testutf8.c utf8.o
int main(int argc, char *args[])
{
char *locale;
locale = setlocale(LC_ALL, "");
char *str="a£b\\u2620";
char *un=malloc(100);
u8_unescape(un, 100, str);
printf("%s\n", str);
printf("%s\n", un);
return 0;
}
I get the following output:
$ ./testutf8
a£b\u2620
ab☠
Expected output was:
a£b☠
Why is the char '£' removed after u8_unescape()
, is there anything wrong with the example code?
Thanks for any hints.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.