Subversion Repositories spk

Rev

Rev 174 | Rev 186 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 175
Line 9... Line 9...
9

9

10
namespace Utils {
10
namespace Utils {
11

11

12
	std::wstring s2ws(const std::string& str)
12
	std::wstring s2ws(const std::string& str)
13
	{
13
	{
-
 
14
		try {
14
		using convert_typeX = std::codecvt_utf8<wchar_t>;
15
			using convert_typeX = std::codecvt_utf8<wchar_t>;
15
		std::wstring_convert<convert_typeX, wchar_t> converterX;
16
			std::wstring_convert<convert_typeX, wchar_t> converterX;
16

17

17
		return converterX.from_bytes(str);
18
			return converterX.from_bytes(str);
-
 
19
		}
-
 
20
		catch(std::exception)
-
 
21
		{
-
 
22

-
 
23
		}
-
 
24
		return std::wstring(L"");
18
	}
25
	}
19

26

20
	std::string ws2s(const std::wstring& wstr)
27
	std::string ws2s(const std::wstring& wstr)
21
	{
28
	{
22
		using convert_typeX = std::codecvt_utf8<wchar_t>;
29
		using convert_typeX = std::codecvt_utf8<wchar_t>;