readium / SDKLauncher-iOS

A small iOS application to serve as a launcher/testbed for the Readium SDK.
BSD 3-Clause "New" or "Revised" License
71 stars 47 forks source link

Encoding issues with some EPUBs on iOS #71

Closed olivierkorner closed 8 years ago

olivierkorner commented 8 years ago

Non-ASCII characters are rendered wrong, as if UTF-8 file was read as Latin-1. I can provide a book for testing (by email olivierkorner@artbookmagazine.com).

The book is displayed correctly Chrome. Adding <meta charset="UTF-8"> to the reader html file seems to solve the problem though...

readium-ios-encoding-issue

danielweck commented 8 years ago

Hello @olivierkorner yes please, send me the EPUB via email. Thanks!

rkwright commented 8 years ago

@olivierkorner Can you share the book with us? Is the font embedded in the EPUB or is it being loaded from the system?

danielweck commented 8 years ago

@olivierkorner where is the EPUB file? (missing attachment?)

danielweck commented 8 years ago

I am able to reproduce this bug in OSX. I will look into it.

rkwright commented 8 years ago

I also reproduced on iOS and OSX but it is NOT present in the Chrome Extension (2.22.2). I'll try Android next, just to see,

rkwright commented 8 years ago

The problem does not occur with the current (0.23-alpha) build on Android using my Nexus 7 with Marshmallow.

danielweck commented 8 years ago

Thank you @olivierkorner for your tip about <meta charset="UTF-8"> in reader.html (single, multiple RequireJS bundles etc.) I verified other potential causes for the encoding mismatch, to no avail. Your simple trick works in OSX (I haven't tried iOS, but it looks like you checked yourself).

olivierkorner commented 8 years ago

@danielweck Yes, tested on iOS

msintov commented 8 years ago

Thank you for this post!! Fixed for me on iOS too.

danielweck commented 8 years ago

Fixed in iOS: https://github.com/readium/SDKLauncher-iOS/commit/8acd4522b4fa11a346ae8a37cf3ad85045d8654a

Fixed in OSX: https://github.com/readium/SDKLauncher-OSX/commit/16bb86c92b34e3b0bf21d79ebbb3098b20f400e0

danielweck commented 8 years ago

Addressed in Android too, to prevent future issues because of the missing meta UTF8 charset tag: https://github.com/readium/SDKLauncher-Android/commit/49734b29238c969c21643d80aeee05e36ba1035a