Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
927 B

  1. .TH fmt_utf8 3
  2. .SH NAME
  3. fmt_utf8 \- encode 31-bit unsigned integer using UTF-8 rules
  5. .B #include <fmt.h>
  6. size_t \fBfmt_utf8\fP(char *\fIdest\fR,uint32_t \fIsource\fR);
  8. fmt_utf8 encodes a 31-bit unsigned integer using the UTF-8 rules. This
  9. can take from 1 byte (0-0x7f) up to 5 bytes (0x4000000-0x7fffffff).
  10. Values larger than 0x7fffffff cannot be represented in this encoding.
  11. If \fIdest\fR equals FMT_LEN (i.e. is NULL), fmt_utf8 returns the
  12. number of bytes it would have written.
  13. For convenience, fmt.h defines the integer FMT_UTF8 to be big enough to
  14. contain every possible fmt_utf8 output.
  15. .SH NOTE
  16. fmt_utf8 and scan_utf8 implement the encoding from UTF-8, but are meant
  17. to be able to store integers, not just Unicode code points. Values
  18. larger than 0x10ffff are not valid UTF-8 (see RFC 3629) but can be
  19. represented in the encoding, so fmt_utf8 will allow them.
  20. .SH "SEE ALSO"
  21. scan_utf8(3)