mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
27 lines
634 B
C
27 lines
634 B
C
|
|
/* $Id$ */
|
|||
|
|
|
|||
|
|
#include <stdio.h>
|
|||
|
|
#include <assert.h>
|
|||
|
|
|
|||
|
|
#include <polypcore/utf8.h>
|
|||
|
|
#include <polypcore/xmalloc.h>
|
|||
|
|
|
|||
|
|
int main(int argc, char *argv[]) {
|
|||
|
|
char *c;
|
|||
|
|
|
|||
|
|
assert(pa_utf8_valid("hallo"));
|
|||
|
|
assert(pa_utf8_valid("hallo\n"));
|
|||
|
|
assert(!pa_utf8_valid("h<EFBFBD>pfburg\n"));
|
|||
|
|
assert(pa_utf8_valid("hallo\n"));
|
|||
|
|
assert(pa_utf8_valid("hüpfburg\n"));
|
|||
|
|
|
|||
|
|
printf("LATIN1: %s\n", c = pa_utf8_filter("h<EFBFBD>pfburg"));
|
|||
|
|
pa_xfree(c);
|
|||
|
|
printf("UTF8: %sx\n", c = pa_utf8_filter("hüpfburg"));
|
|||
|
|
pa_xfree(c);
|
|||
|
|
printf("LATIN1: %sx\n", c = pa_utf8_filter("<EFBFBD>xkn<EFBFBD>rzm<EFBFBD>rzelt<EFBFBD>rsz߳<EFBFBD>dsjkfh"));
|
|||
|
|
pa_xfree(c);
|
|||
|
|
|
|||
|
|
return 0;
|
|||
|
|
}
|