When uploading activity data to strava, if the activity name and description are not in English, what encoding format should I use to transmit them so that they can be correctly displayed in the strava app
I tried to encode the Chinese through US_ASCII, base64,utf-8, etc., but the unmatched Chinese characters could not be displayed in strava app
All text fields in Strava use UTF-8. If you look at the headers for any API response you should see:
Content-Type: application/json; charset=utf-8
My suggestion would be to use the app/website to manually update the activity using the characters which are not being displayed properly. Make sure they show up correctly so you can confirm that Strava handles them as expected.
Assuming they are displayed correctly, use the API to retrieve the activity data (https://developers.strava.com/docs/reference/#api-Activities-getActivityById) and look at how the data is encoded in the returned response.
Finally, try using the API to update the activity using the same encoding and see if the characters are displayed as expected. You could even just get the activity data and issue an update using the exact same data that was returned to confirm it is handled correctly.
Reply
Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.