Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16149] LiveView: does not decode XML entities in i18n strings.xml

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-02-15T00:33:44.000+0000
Affected Version/sRelease 3.1.3, Release 3.2.0
Fix Version/s2014 Sprint 03, 2014 Sprint 03 Tooling, Release 3.2.3, Release 3.3.0
ComponentsLiveView
LabelsLiveView, qe-closed-3.2.3, qe-testadded, supportTeam
ReporterRupesh Sharma
AssigneeChristian Sullivan
Created2014-01-08T12:20:08.000+0000
Updated2014-03-14T17:40:54.000+0000

Description

Description

i18n strings.xml contain xml entity & (as &). When it is run with live view enabled then it does not decode it and shows output as & in simulator.

Test Case

app.js
var win = Titanium.UI.createWindow({
    backgroundColor : '#fff'
});

win.add(Titanium.UI.createLabel({
    color : '#333',
    text : L('test_str'),
}));

win.open();
strings.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <string name="test_str">Some & more</string>
</resources>

Expected Output

Some & more

Output when running in LiveView

Some amp; more

Comments

  1. Christian Sullivan 2014-01-08

    [~ingo][~mxia] sounds like it might have been something cause by a ti sdk issue because I don't think I have changed anything for the i18n implementation since I added it. It sounds like a bug may have been fixed with JSON.parse
  2. Michael Xia 2014-01-08

    I'm going to mark this as resolved for 3.2.0 since the description indicates the issue is no longer reproducible in 3.2.0.
  3. Michael Xia 2014-02-13

    [~csullivan] Could you help take a look at this issue when you get a chance?
  4. Christian Sullivan 2014-02-14

    PR [MASTER] https://github.com/appcelerator/liveview/pull/78 [~mxia] ^^
  5. Michael Xia 2014-02-15

    Merged the PR and included the new version in Appcelerator Studio 3.2.3/3.3.0.
  6. Olga Romero 2014-03-13

    Tested and verified the fix with: Mac osx 10.9.2 Mavericks Appcelerator Studio, build: 3.2.2.201403061827 Titanium SDK, build:3.2.3.v20140312170355 LiveView Version: 1.0.3 Node.JS Version: v0.10.13 NPM Version: 1.3.2 ├── acs@1.0.14 ├── alloy@1.3.1 ├── npm@1.3.2 ├── titanium@3.2.1 Devices: Nexus 4 Android version 4.4 iPhone 5s iOS version 7.1 Created the default project Added i18n folder to the root Created strings.xml file Ran the project on devices (same network with the desktop) Actual result: "Some & more"

JSON Source