fix: put 'char' type directly to the output stream
Char type was converted to wchar_t and then was serialized as utf-8 stream. Let char type will always be one char, of course it need to be a valid utf-8 sequence. Let FT::dont_use_utf8 apply only to wchar_t and std::wstring but ignore it if FT::hexadecimal or FT::binary are defined. Now we have bool BaseExpression::esc_char(wchar_t val, pt::TextStream & stream) method which (in most cases) will be used in derived classes. Let wchar_t (and std::wstring) will be stored as 8 hex digits when using FT::hexadecimal or FT::binary (and ignore FT::dont_use_utf8 in such a case).
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2018-2021, Tomasz Sowa
|
||||
* Copyright (c) 2018-2022, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -100,9 +100,11 @@ protected:
|
||||
|
||||
void log_unsupported_bin_format();
|
||||
|
||||
size_t unescape_bin_char(const char * str, wchar_t & field_value, const FT & field_type);
|
||||
void unescape_bin_char(const char * str, char & field_value);
|
||||
void unescape_bin_char(const char * str, wchar_t & field_value);
|
||||
|
||||
void unescape_bin_string(const char * str, std::string & out);
|
||||
void unescape_bin_string(const char * str, std::wstring & out, const FT & field_type);
|
||||
void unescape_bin_string(const char * str, std::wstring & out);
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user