unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* scm_to_locale_stringbuf
@ 2009-02-03 16:25 Mike Gran
  2009-02-03 22:48 ` scm_to_locale_stringbuf Neil Jerram
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Gran @ 2009-02-03 16:25 UTC (permalink / raw)
  To: guile-devel

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-08 21:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 16:25 scm_to_locale_stringbuf Mike Gran
2009-02-03 22:48 ` scm_to_locale_stringbuf Neil Jerram
2009-02-03 23:46   ` scm_to_locale_stringbuf Mike Gran
2009-02-04  0:23     ` scm_to_locale_stringbuf Neil Jerram
2009-02-05 22:26       ` scm_to_locale_stringbuf Ludovic Courtès
2009-02-08 21:41         ` scm_to_locale_stringbuf Neil Jerram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).