Skip to content

Commit

Permalink
Python Use UTF8 and untranslated Series Names
Browse files Browse the repository at this point in the history
.. 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.
  • Loading branch information
sisao authored and liversedge committed Dec 10, 2017
1 parent b3680c0 commit 80e786c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Python/SIP/Bindings.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Python/SIP/goldencheetah.sip
Expand Up @@ -36,7 +36,7 @@
return 0;
%End
%ConvertFromTypeCode
return PyUnicode_FromString(sipCpp->toLatin1().data());
return PyUnicode_FromString(sipCpp->toUtf8().data());
%End
};

Expand Down
2 changes: 1 addition & 1 deletion src/Python/SIP/sipgoldencheetahQString.cpp
Expand Up @@ -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"
}

Expand Down

0 comments on commit 80e786c

Please sign in to comment.