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
libFolder - 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 TheincludeFolder 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
InputSourcestruct was added to theutf-utils.hfile.With this struct, you will be able to give it
char16_tbased strings or string_viewschar32_tbased strings or string_viewschar/unsigned charstrings or string_viewsc-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
inputmember 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 chartosigned charifcharis implemented as asigned char)
- 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
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
inputmember variable, otherwise it will use move semantics to move the input to theinputmember variable - In the case of UTF-16LE and UTF-32LE, it will reserve the length needed in the
inputmember variable before conversion occurs.
- In the case of lvalues and xvalues, it will just assign to the
NOTE: In the case of an invalid input or one that could NOT be converted to UTF-8, the
inputmember variable will be empty, so a quick check for success is to check ifif(InputSource::input.size() !=0){/\* Continue \*/}or something like
if(InputSource::input.empty()){/\* Handle Error \*/} - The Compiled Version Of This Library Under The
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
libFolder - 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 TheincludeFolder 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
- The Compiled Version Of This Library Under The