Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2560] Android: Locale strings with quotes/apostrophes cause syntax errors in generated strings.xml

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:59:27.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M02
ComponentsAndroid
Labelsandroid, defect, locale, release-1.6.0, strings
ReporterMarshall Culpepper
AssigneeBill Dawson
Created2011-04-15T03:22:47.000+0000
Updated2011-04-17T01:59:27.000+0000

Description

Android strings inside a <string> tag must be escaped if they use quotes or apostrophes. From the ADT strings.xml editor:
"If you use an apostrophe or a quote in your string, you must either escape it or enclose the whole string in the other kind of enclosing quotes."

The escape character is simply "\"

Attachments

FileDateSize
quotestring.zip2011-04-15T03:22:48.000+0000770498

Comments

  1. Bill Dawson 2011-04-15

    To QA:

    You can test this by importing the attached project in QuoteString.zip. In the failcase, it won't even compile when you click 'Launch', because it has some values in i18n/en/strings.xml which contain single and double quotes that are not preceded by backslashes (required by the Android resource compiler.)

    After you install the fixed version of the mobile sdk, the project should launch fine, and you'll see two labels (about Jimmy Stewart) which should match each other. One is typed directly into the .JS file, the other is getting the string from the i18n/en using our localization framework.

  2. Bill Dawson 2011-04-15

    (from [9bdcc77bd04c006be3b9c1bd739d45f37fdd4b4f]) [#2560 state:fixed-in-qa] In string resources (i18n), check for quotes and double-quotes not preceded by backslashes and fix them https://github.com/appcelerator/titanium_mobile/commit/9bdcc77bd04c006be3b9c1bd739d45f37fdd4b4f"> https://github.com/appcelerator/titanium_mobile/commit/9bdcc77bd04c...

  3. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/04/11 08:01 e49700d) emulator 2.2, device 2.2.1 droid 1 and 1.6 g1.

JSON Source