]> git.proxmox.com Git - ceph.git/blame - ceph/src/common/win32/wstring.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / common / win32 / wstring.cc
CommitLineData
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
17using boost::locale::conv::utf_to_utf;
18
19std::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
24std::string to_string(const std::wstring& str)
25{
26 return utf_to_utf<char>(str.c_str(), str.c_str() + str.size());
27}