Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3080] Android: Deploy Corrupts UTF-8 Characters

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-10
ComponentsAndroid
Labelsandroid, defect, release-1.6.1, release-1.7.0, reported-1.6.0, rplist
ReporterDawson Toth
AssigneeDon Thorp
Created2011-04-15T03:36:18.000+0000
Updated2011-04-17T02:00:51.000+0000

Description

Problem

UTF-8 characters in JavaScript get corrupted by the Android deployment build scripts in Titanium.

Sample Project

  1. Run the attached project in the emulator. It is based on the default, two tab project. The only difference is the labels have UTF-8 characters in them. Notice there is an Umlaut above the "ö" in "Min förbrukning".
  2. Create an apk of the project by using the "Distribute" > "Android" tab. If you run this APK on the device, you'll notice the UTF-8 characters are now corrupt.
  3. Without cleaning the build, run the project in the emulator. The UTF-8 characters should be messed up here as well. On my machine, the O with Umlaut was replaced with a check mark (√).

Tested On

Titanium SDK version: 1.6.0 (02/02/11 15:22 a02f7db...)
Android Emulator 2.2

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/70681">http://developer.appcelerator.com/helpdesk/view/70681

Attachments

FileDateSize
utf8test.zip2011-04-15T03:36:19.000+00004766874

Comments

  1. Dawson Toth 2011-04-15

    It would help if I attached the project...

  2. Rich Kilmer 2011-04-15

    We have experienced this exact same issue today when we were about to release an application just updated to 1.5.1 to QA and (soon) the Marketplace. This issue is critical to us. If someone can point us to a place to look we will help out :)

  3. Dawson Toth 2011-04-15

    2nd Associated Helpdesk Ticket

    http://developer.appcelerator.com/helpdesk/view/76272">http://developer.appcelerator.com/helpdesk/view/76272

  4. Dawson Toth 2011-04-15

    This 3rd customer actually has a patch for the build scripts, provided in the ticket:

    3rd Associated Helpdesk Ticket

    http://developer.appcelerator.com/helpdesk/view/76261">http://developer.appcelerator.com/helpdesk/view/76261

  5. Marco 2011-04-15

    We have the same problem.
    Encoding works on simulator an with "Run on Device".
    As soon as we compile an apk for distribution all UTF-8 Characters are corrupted.

    This starts from version 1.5.x on.
    As lon as we use 1.4.x it works.

    I noticed when I use the optional folder /platform/android/AndroidManifest.xml for a custom Manifest during compilation an additional AndroidManifest.xml.gen is created under /build/android/. This file is not identical with the custom one. Especially the header and the permissiona are different.

    This is a big problem for all countries using special characters (Germany, France, Spain etc.) as you cannot use Titanium anymore for compiling apps for distribution.

    We would use 1.4.x but lot of code designed for 1.5-x won´t work.

    Any workarounds in sight?

  6. Christian 2011-04-15

    Also it seems that the problem exists on OS-X and Windows 7 likewise.

  7. Marshall Culpepper 2011-04-15

    (from [6d9b0f3e05ba71621da82c4ca98f4d5d1b250705]) force utf8 encoding in the js compiler, correctly deal with an absolute prefix on an app:// URL for compiled JS, matching up with the behavior
    in interpreted mode [#3312 state:fixed-in-qa] [#3080 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/6d9b0f3e05ba71621da82c4ca98f4d5d1b250705"> https://github.com/appcelerator/titanium_mobile/commit/6d9b0f3e05ba...

  8. Marshall Culpepper 2011-04-15

    (from [89c196d407d96d587e0c7883d6670e6523ff52c3]) force utf8 encoding in the js compiler, correctly deal with an absolute prefix on an app:// URL for compiled JS, matching up with the behavior
    in interpreted mode [#3312 state:fixed-in-qa] [#3080 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/89c196d407d96d587e0c7883d6670e6523ff52c3"> https://github.com/appcelerator/titanium_mobile/commit/89c196d407d9...

  9. Natalie Huynh 2011-04-15

    Tested with Titanium SDK version: 1.6.1 (03/10/11 13:25 2e8c438...) on
    Emulator 2.1
    Samsung Galaxy 2.2 (Tested with distribution package)

  10. Natalie Huynh 2011-04-15

    Tested with Titanium SDK version: 1.7.0 (03/11/11 12:08 86cfe14) on
    Emulator 2.1
    Samsung Galaxy 2.2 (Tested with distribution package)

  11. Marshall Culpepper 2011-04-15

    (from [727a5e1d7bc90e0c26ee528075f4648fe6fa14e7]) force utf8 encoding in the js compiler, correctly deal with an absolute prefix on an app:// URL for compiled JS, matching up with the behavior
    in interpreted mode [#3312 state:fixed-in-qa] [#3080 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/727a5e1d7bc90e0c26ee528075f4648fe6fa14e7"> https://github.com/appcelerator/titanium_mobile/commit/727a5e1d7bc9...

  12. Don Thorp 2011-04-15

    Cherry-pick changed the state. Reversing that change.

JSON Source