mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Python Use UTF8 and untranslated Series Names
.. With german translation activated GC.activity() complains about some utf-8 decoding stuff and returns error. First I thought came from the real activity json file, but it's from translation: Altitude -> Höhenmeter. Is it necessary to use toLatin1() in goldencheetah.sip? With toUtf8() it works and you get delta symbols instead of question marks. .. With R the series names are always in english and use a naming convention derived from the R trackR package -- we now follow the same in Python bindings to ensure charts created in one locale will continue to work in another.
This commit is contained in:
@@ -54,7 +54,7 @@ Bindings::seriesLast() const
|
||||
QString
|
||||
Bindings::seriesName(int type) const
|
||||
{
|
||||
return RideFile::seriesName(static_cast<RideFile::SeriesType>(type));
|
||||
return RideFile::seriesName(static_cast<RideFile::SeriesType>(type), true);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
return 0;
|
||||
%End
|
||||
%ConvertFromTypeCode
|
||||
return PyUnicode_FromString(sipCpp->toLatin1().data());
|
||||
return PyUnicode_FromString(sipCpp->toUtf8().data());
|
||||
%End
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ static PyObject *convertFrom_QString(void *sipCppV, PyObject *)
|
||||
::QString *sipCpp = reinterpret_cast< ::QString *>(sipCppV);
|
||||
|
||||
#line 39 "goldencheetah.sip"
|
||||
return PyUnicode_FromString(sipCpp->toLatin1().data());
|
||||
return PyUnicode_FromString(sipCpp->toUtf8().data());
|
||||
#line 68 "./sipgoldencheetahQString.cpp"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user