44
44
namespace Conversion
46
// UString -> QString conversion. Use .string() to get the QString.
47
// Always store the QString into a variable first, to avoid a deep copy.
46
const int MS_SYMBOL_ENCODING[256] = {
47
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
48
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
49
32, 33, 8704, 35, 8707, 37, 38, 8715, 40, 41, 8727, 43, 44, 8722, 46, 47,
50
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
51
8773, 913, 914, 935, 916, 917, 934, 915, 919, 921, 977, 922, 923, 924, 925, 927,
52
928, 920, 929, 931, 932, 933, 962, 937, 926, 936, 918, 91, 8756, 93, 8869, 95,
53
8254, 945, 946, 967, 948, 949, 966, 947, 951, 953, 981, 954, 955, 956, 957, 959,
54
960, 952, 961, 963, 964, 965, 982, 969, 958, 968, 950, 123, 124, 125, 8764, 0,
55
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
56
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
57
0, 978, 8242, 8804, 8725, 8734, 402, 9827, 9830, 9829, 9824, 8596, 8592, 8593, 8594, 8595,
58
176, 177, 8243, 8805, 215, 8733, 8706, 8729, 247, 8800, 8801, 8776, 8943, 0, 0, 8629,
59
0, 8465, 8476, 8472, 8855, 8853, 8709, 8745, 8746, 8835, 8839, 8836, 8834, 8838, 8712, 8713,
60
8736, 8711, 174, 169, 8482, 8719, 8730, 8901, 172, 8743, 8744, 8660, 8656, 8657, 8658, 8659,
61
9674, 9001, 0, 0, 0, 8721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
62
0, 9002, 8747, 8992, 0, 8993, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
64
// UString -> QString conversion.
48
65
inline QString string(const wvWare::UString& str)
50
// Let's hope there's no copying of the QConstString happening...
51
return QString::fromRawData(reinterpret_cast<const QChar*>(str.data()), str.length());
67
// Do a deep copy. We used to not do that, but it lead to several
68
// memory corruption bugs that were difficult to find.
70
// FIXME: Get rid of UString altogether and port wv2 to QString.
71
return QString(reinterpret_cast<const QChar*>(str.data()), str.length());
54
74
//special version of string() that replaces spaces with _20_,