UTF-Utils v1.0.1 Release Notes

Release Date: 2022-10-30 // over 3 years ago
  • Compiled Version Of This Library.

    NOTE:

    This IS A Header-Only Library, But For Convenience's Sake, This Release Contains:

    • The Compiled Version Of This Library Under The lib Folder
    • The Header Files Under include.

    This Is The Same As If The Build Option "BUILD_COMPILED_LIBRARY" Was Enabled And CMake Was Run To Build The Compiled Library. If You Do NOT Need Or Want To Use The Compiled Versions Under lib, Then All You Need To Do Is Add The include Folder To Your Project And #include<UTF-Utils/utf-utils.h> Or #include "UTF-Utils/utf-utils.h" In The Project Itself.


    🔄 Changes Made


    The only real change from v1.0.0 is that a new InputSource struct was added to the utf-utils.h file.

    • With this struct, you will be able to give it

      • char16_t based strings or string_views
      • char32_t based strings or string_views
      • char/unsigned char strings or string_views
      • c-style strings (implicit conversion to string_view occurs)
    • The utility this struct provides is to explicitly convert the input source into UTF-8 and store the result in the input member variable

      • It does this through the templatized overloads passing the input source to the relevant conversion functions that are implemented in this library, validating the UTF-8 sequence, and storing it as a string (converting unsigned char to signed char if char is implemented as a signed char)
    • This struct's functions have been templatized for overload resolution of input types and will be efficient in its storage via detecting if the input is an rvalue, lvalue, or xvalue (if it's a basic char type).

      • In the case of lvalues and xvalues, it will just assign to the input member variable, otherwise it will use move semantics to move the input to the input member variable
      • In the case of UTF-16LE and UTF-32LE, it will reserve the length needed in the input member variable before conversion occurs.

    NOTE: In the case of an invalid input or one that could NOT be converted to UTF-8, the input member variable will be empty, so a quick check for success is to check if

    if(InputSource::input.size() !=0){/\* Continue \*/}
    

    or something like

    if(InputSource::input.empty()){/\* Handle Error \*/}
    

Previous changes from v1.0.0

  • Compiled Version Of This Library.

    NOTE:

    This IS A Header-Only Library, But For Convenience's Sake, This Release Contains:

    • The Compiled Version Of This Library Under The lib Folder
    • The Header Files Under include.

    This Is The Same As If The Build Option "BUILD_COMPILED_LIBRARY" Was Enabled And CMake Was Run To Build The Compiled Library. If You Do NOT Need Or Want To Use The Compiled Versions Under lib, Then All You Need To Do Is Add The include Folder To Your Project And #include<UTF-Utils/utf-utils.h> Or #include "UTF-Utils/utf-utils.h" In The Project Itself.

    • ⚡️ updated CMakeLists.txt to fix header source tree