OpenClinica/enketo-express-oc

Odd characters displaying for foreign languages in Offline

Closed this issue · 6 comments

Describe the bug
The Offline form corrupts non-ASCII characters. Online forms display correctly.

To Reproduce
I can see the odd characters when selecting French or Portuguese

Portuguese

XForm

XForm_Offline_ascii_issue.txt

@Apotischman - Can you send Martijn an email with a link to this form (offline and online) so that he can debug in his browser.

see live links in email sent on 4/13

But I can reproduce with the live link.

The difference in cached items that the OC page strangely enough has a cache item for Japanese (though the app sadly is not translated into Japanese). Klingon fails to load for both as expected (sadly). That doesn't seem likely to be the cause of this issue though.

Both pages are displaying the same font (which is cached in both).

  • check transformer result.

Screen Shot 2022-04-14 at 10 52 19 AM

Screen Shot 2022-04-14 at 10 50 30 AM

  • compare HTTP requests to same OC server for online and offline views

Don't see difference in request, just the response body.
Both online-only and offline-capable views obtain same transformation result from server cache. Somehow these results are served (encoded) differently though (by the OC Enketo server)

Aha!

These live encrypted IDs should be the same for the the online-only and offline-capable views of the same form but they are not! So from Enketo's perspective these are two different XForms (i.e. with different form IDs and/or server URLs) and the transformation results are stored in different database entries. 

When manually changing the functioning online-only URL to an offline-capable URL (by replacing /single/ with /x/), it also works. And vice versa, you can create a problematic URL that is online-only.

Surprisingly it looks like the XForm is actually encoded correctly, so my best guess is that transformation was broken at the time the transformation result was cached on the server (in redis).

@Apotischman, could you try uploading the same form again? This will give us an idea of whether the transformation issue is recent or old. (I'm guessing it's not which would explain why I cannot reproduce it locally)

This is no longer reproducible. It was tested multiple times on the OC side.