Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F225415
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/Scylla/StringConversion.cpp b/Scylla/StringConversion.cpp
new file mode 100644
index 0000000..912c560
--- /dev/null
+++ b/Scylla/StringConversion.cpp
@@ -0,0 +1,22 @@
+#include "StringConversion.h"
+//#include <cstdlib>
+#include <atlbase.h>
+#include <atlconv.h>
+
+const char* StringConversion::ToASCII(const wchar_t* str, char* buf, size_t bufsize)
+{
+ //wcstombs(buf, str, bufsize);
+ ATL::CW2A str_a = str;
+ strncpy_s(buf, bufsize, str_a, bufsize);
+ buf[bufsize - 1] = '\0';
+ return buf;
+}
+
+const wchar_t* StringConversion::ToUTF16(const char* str, wchar_t* buf, size_t bufsize)
+{
+ //mbstowcs_s(buf, str, bufsize);
+ ATL::CA2W str_w = str;
+ wcsncpy_s(buf, bufsize, str_w, bufsize);
+ buf[bufsize - 1] = L'\0';
+ return buf;
+}
diff --git a/Scylla/StringConversion.h b/Scylla/StringConversion.h
new file mode 100644
index 0000000..27cb433
--- /dev/null
+++ b/Scylla/StringConversion.h
@@ -0,0 +1,9 @@
+#pragma once
+
+class StringConversion
+{
+public:
+
+ static const char* ToASCII(const wchar_t* str, char* buf, size_t bufsize);
+ static const wchar_t* ToUTF16(const char* str, wchar_t* buf, size_t bufsize);
+};
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Mar 16, 11:58 AM (1 d, 20 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c1/cd/8d334313d60ae1db81e9a3a9043b
Attached To
rSCY Scylla
Event Timeline
Log In to Comment