Fully re-implemented from scratch and an original work, this UTF-8 encoder does not rely on the traditional method of range switching in various algorithms but has just one functional while loop to build the string.

Built around this encoder are 6 utf8-printf() functions that allow printing a standard UTF32 - UNIX 32 bit wide character (wchar_t) string to stdout, a string, or a file as a UTF-8 encoded string.

Features

  • Print internal UTF32 strings to UTF8 terminal output with utf8_printf() functions
  • Standard printf() function integer returns plus ferror() and errno set per ISO C standards
  • Handles strings up to 32MB long
  • Very Small Library with a total of 70 lines of code (minus blanks and comments)
  • ---
  • NOTE: Compiles but throws an assertion error on execute and aborts!
  • NOTE: You should never use, it's evil! Google 'buffer overflow'.
  • int utf32_to_utf8(uint32_t encode_value, char *utf8_output);
  • int utf8_printf(const wchar_t *fmt, ...);
  • int utf8_fprintf(FILE *file_handle, const wchar_t *fmt, ...);
  • int utf8_snprintf(char *utf8_output, size_t max_length, const wchar_t *fmt, ...);
  • int utf8_sprintf(char *utf8_output, const wchar_t *fmt, ...); (See note above)
  • int utf8_vsnprintf(char *utf8_output, size_t max_length, const wchar_t *fmt, va_list arg_ptr);
  • int utf8_vsprintf(char *utf8_output, const wchar_t *fmt, va_list arg_ptr); (See note above)

Project Activity

See All Activity >

Follow utf8_printf()

utf8_printf() Web Site

You Might Also Like
ManageEngine Endpoint Central for IT Professionals Icon
ManageEngine Endpoint Central for IT Professionals

A one-stop Unified Endpoint Management (UEM) solution

ManageEngine's Endpoint Central is a Unified Endpoint Management Solution, that takes care of enterprise mobility management (including all features of mobile application management and mobile device management), as well as client management for a diversified range of endpoints - mobile devices, laptops, computers, tablets, server machines etc. With ManageEngine Endpoint Central, users can automate their regular desktop management routines like distributing software, installing patches, managing IT assets, imaging and deploying OS, and more.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of utf8_printf()!

Additional Project Details

Registered

2014-04-21