[vdr] trouble with asprintf
ludwig.nussel at suse.de
Mon Feb 11 15:29:11 CET 2008
Darren Salt wrote:
> I demand that Ludwig Nussel may or may not have written...
> > asprintf needs to check for multibyte characters to not cut them in
> > the middle and produce invalid output.
> No - it's encoding-neutral. What you want is your own version which does that
Try the following with 'LANG=C' and 'LANG=de_DE.UTF-8'. You will
notice that in the latter case it will not cut the umlaut.
char artist = "Haegar";
ret = asprintf(&buffer,"%.2s\n",artist);
printf("%d bytes\n", ret);
(o_ Ludwig Nussel
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
More information about the vdr