On 2 August 2010 09:52, Quintin Willison <[email protected]> wrote:
> But you'll get an error [Apostrophe not preceded by \ (in '"?"')].
> I thought that this would work because the documentation states "If
> you have an apostrophe or a quote in your string, you must either
> escape it or enclose the whole string in the other type of enclosing
> quotes.".
It can be just a bug. Just make a habbit of always using double quotes
and escape all single and double quotes inside the string. It simply
saves some time, as for example these are also not fully correct:
<string name="foo1">This is 'quoted' text</string>
<string name="foo2">"This is "quoted" text"</string>
as the foo1 will throw "Apostrophe not preceded..." error and the
second, while syntax is correct, equals to:
<string name="foo2">"This is quoted text"</string>
which is not what one intended.
And for a record (in case other will be digging in list archive), you
shall keep in mind you are editing XML file, therefore
entries like this:
<string name="foo1">"&"</string>
<string name="foo2">"<"</string>
<string name="foo3">">"</string>
are also invalid despite the quotation and you shall use:
<string name="foo1">"&"</string>
<string name="foo2">"<"</string>
<string name="foo3">">"</string>
instead (quotation is optional there but as I said - use it always -
it won't hurt much).
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en