mirror of
https://github.com/DanielSWolf/rhubarb-lip-sync.git
synced 2026-11-21 12:25:08 +00:00
Implemented string conversion from Latin-1 to Unicode
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
|
||||
using std::string;
|
||||
using std::wstring;
|
||||
using std::u32string;
|
||||
using std::vector;
|
||||
using boost::optional;
|
||||
@@ -81,6 +82,14 @@ vector<string> wrapString(const string& s, int lineLength, int hangingIndent) {
|
||||
return lines;
|
||||
}
|
||||
|
||||
wstring latin1ToWide(const string& s) {
|
||||
wstring result;
|
||||
for (unsigned char c : s) {
|
||||
result.append(1, c);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
optional<char> toASCII(char32_t ch) {
|
||||
switch (ch) {
|
||||
#include "asciiCases.cpp"
|
||||
|
||||
Reference in New Issue
Block a user