Browse code

Lots of changes in regards to strings, as follows:

* Removed my custom String class, as well as removed the really old
Unicode ConvertUTF, the UTF Converter, and the UTF Encode/Decode
functions.
* Replaced the above with using standard C++ std::wstring_convert and
std::codecvt_utf8.
* Added headers adapted from llvm's libc++ project for allowing the
above C++ classes to exist with GCC and Clang when libc++ isn't being
used.
* Used std::string over std::wstring whenever possible.
* Added header adapted from llvm's libc++ project to create special
versions of the ifstream and ofstream classes that would utilize _wfopen
on non-MSVC Windows compilers, so those compilers could access files on
Windows that use characters outside the current codepage.
* Removed the -static-libgcc and -static-libstdc++ flags from the
Makefile for non-MSVC builds. The generated DLLs will require extra DLLs
from either Cygwin or MinGW (whichever is used to compile), I've only
tested with MinGW and for some reason they crash Winamp on exit, I have
no idea why.

Naram Qashat authored on 2014/09/24 13:58:55
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,12 +0,0 @@
1
-// original code is from here: http://www.codeproject.com/Articles/17573/Convert-Between-std-string-and-std-wstring-UTF-8-a
2
-// License: The Code Project Open License (CPOL) http://www.codeproject.com/info/cpol10.aspx
3
-
4
-#pragma once
5
-
6
-#include <string>
7
-
8
-namespace UtfConverter
9
-{
10
-	std::wstring FromUtf8(const std::string &);
11
-	std::string ToUtf8(const std::wstring &);
12
-}
Browse code

Use #pragma once instead of include guards.

Naram Qashat authored on 2014/09/08 14:47:36
Showing 1 changed files
... ...
@@ -1,8 +1,7 @@
1 1
 // original code is from here: http://www.codeproject.com/Articles/17573/Convert-Between-std-string-and-std-wstring-UTF-8-a
2 2
 // License: The Code Project Open License (CPOL) http://www.codeproject.com/info/cpol10.aspx
3 3
 
4
-#ifndef UTFCONVERTER_H
5
-#define UTFCONVERTER_H
4
+#pragma once
6 5
 
7 6
 #include <string>
8 7
 
... ...
@@ -11,5 +10,3 @@ namespace UtfConverter
11 10
 	std::wstring FromUtf8(const std::string &);
12 11
 	std::string ToUtf8(const std::wstring &);
13 12
 }
14
-
15
-#endif
Browse code

Import actual code.

Naram Qashat authored on 2013/03/26 02:41:19
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+// original code is from here: http://www.codeproject.com/Articles/17573/Convert-Between-std-string-and-std-wstring-UTF-8-a
2
+// License: The Code Project Open License (CPOL) http://www.codeproject.com/info/cpol10.aspx
3
+
4
+#ifndef UTFCONVERTER_H
5
+#define UTFCONVERTER_H
6
+
7
+#include <string>
8
+
9
+namespace UtfConverter
10
+{
11
+	std::wstring FromUtf8(const std::string &);
12
+	std::string ToUtf8(const std::wstring &);
13
+}
14
+
15
+#endif