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

Other Useful Business Software
Skillfully - The future of skills based hiring Icon
Skillfully - The future of skills based hiring

Realistic Workplace Simulations that Show Applicant Skills in Action

Skillfully transforms hiring through AI-powered skill simulations that show you how candidates actually perform before you hire them. Our platform helps companies cut through AI-generated resumes and rehearsed interviews by validating real capabilities in action. Through dynamic job specific simulations and skill-based assessments, companies like Bloomberg and McKinsey have cut screening time by 50% while dramatically improving hire quality.
Learn 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