peerplays-fc/include/fc/utf8.hpp
vogel76 59f80e34d2 [BW]: [NIP] Further changes to get to work paths containing unicode characters:
- fc::path extended by method toNativeAnsiPath allowing to safely convert current unicode path into its ansi equivalent
- fc::path to_variant uses toNativeAnsiPath method instead of generic_string to avoid loss of data while serializing a path
- fc::mmap_struct_base::open should use toNativeAnsiPath method instead of generic_string to access ansi path
- fc::json::save_to_file should directly pass fc::path to underlying stream instead of generic_string.
2014-01-10 00:05:18 +01:00

26 lines
743 B
C++

#ifndef __UTF8_HPP
#define __UTF8_HPP
#include <string>
/// This file contains general purpose utilities related to UTF-8 <-> Unicode conversions
namespace fc
{
/** Decodes utf 8 std::string into unicode string.
@param input - input string to be decoded and stored in 'storage'
@param storage - buffer for converted text. Cannot be nullptr.
*/
void decodeUtf8(const std::string& input, std::wstring* storage);
/** Encodes given wide (unicode) string into UTF-8 representation.
@param input - input string to be encoded and stored in 'storage'
@param storage - buffer for converted text. Cannot be nullptr.
*/
void encodeUtf8(const std::wstring& input, std::string* storage);
} /// namespace fc
#endif ///__UTF8_HPP