I'm trying to help with simple64 which uses qt6 and displaying the sJIS rom header to utf8 correctly.
The SJIS Header is Japanese.
At the moment it's showing ������Ϻޯ�ܰ��� (sJIS) or this ÐÝÅÃÞÀϺޯÁܰÙÄÞ (utf8) when I'm using a QByteArray to try and convert it.
The code currently uses this:
output = QString("%1: %2").arg((const char *) Context, message);
I know that %2 contains the string I need, unfortunately it just displays as a great big information dump.
I've tried doing this code in an attempt to split the strings so I can isolate the one in question:
void split(const QByteArray & a, QList<QByteArray> & l, int n)
{
for (int i = 0; i < a.size(); i+= n)
{
l.push_back(a.mid(i, n));
}
}
void DebugCallback(void *Context, int level, const char *message)
{
if (level == M64MSG_INFO)
{
split(ba, ql, ba.length());
for (QList<QByteArray>::const_iterator itl = ql.constBegin();
itl != ql.constEnd(); ++itl)
{
const QByteArray & a = *itl;
for(QByteArray::const_iterator ita = a.constBegin();
ita != a.constEnd(); ++ita)
{
output += *ita;
}
output += "\n";
}
What am I missing for the conversion? Also I don't want to use the qt5Compatibility as it adds more dlls just to solve this.
I'm semi-positive I could use the QLocale::language but i'm not sure on it's usage even after checking the documentation.
The conversion needs to work for any sJIS characters.