guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scm_to_locale_stringbuf


From: Mike Gran
Subject: scm_to_locale_stringbuf
Date: Tue, 3 Feb 2009 08:25:48 -0800 (PST)

Hi,

The description for scm_to_locale_stringbuf doesn't specify
what happens when the final multibyte character doesn't fit 
in the provided string buffer.

size_t scm_to_locale_stringbuf (SCM str, char *buf, size_t max_len)

Say the locale is UTF-8, and the last position in BUF would be 
the first byte of a two-byte character.  The right thing is not 
to copy that first byte of the character into the last position 
of BUF, but, instead copy a '\0'.  But there is no way to indicate 
to the caller that the final '\0' is padding and not a true '\0'.

Ideas?

Thanks,

Mike Gran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]