]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | /* |
2 | * Ceph - scalable distributed file system | |
3 | * | |
4 | * Copyright (C) 2022 Cloudbase Solutions | |
5 | * | |
6 | * This is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU Lesser General Public | |
8 | * License version 2.1, as published by the Free Software | |
9 | * Foundation. See file COPYING. | |
10 | * | |
11 | */ | |
12 | ||
13 | #include "wstring.h" | |
14 | ||
15 | #include <boost/locale/encoding_utf.hpp> | |
16 | ||
17 | using boost::locale::conv::utf_to_utf; | |
18 | ||
19 | std::wstring to_wstring(const std::string& str) | |
20 | { | |
21 | return utf_to_utf<wchar_t>(str.c_str(), str.c_str() + str.size()); | |
22 | } | |
23 | ||
24 | std::string to_string(const std::wstring& str) | |
25 | { | |
26 | return utf_to_utf<char>(str.c_str(), str.c_str() + str.size()); | |
27 | } |