mail-archives/monodroid/2011-December/007465.html

99 строки
3.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] Whitespace not being respected in Strings.xml?
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Whitespace%20not%20being%20respected%20in%20Strings.xml%3F&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007485.html">
<LINK REL="Next" HREF="007468.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] Whitespace not being respected in Strings.xml?</H1>
<B>warren burch</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Whitespace%20not%20being%20respected%20in%20Strings.xml%3F&In-Reply-To="
TITLE="[mono-android] Whitespace not being respected in Strings.xml?">warrenburch at gmail.com
</A><BR>
<I>Sat Dec 3 03:24:19 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="007485.html">[mono-android] intellisense in md with m4a
</A></li>
<LI>Next message: <A HREF="007468.html">[mono-android] Whitespace not being respected in Strings.xml?
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7465">[ date ]</a>
<a href="thread.html#7465">[ thread ]</a>
<a href="subject.html#7465">[ subject ]</a>
<a href="author.html#7465">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>in my Strings.xml file I have items which have leading and trailing
whitespace, when these strings are read from the resource these leading and
trailing whitespaces are trimmed.
taking the template app add the following to Strings.xml
&lt;resources&gt;
&lt;string name=&quot;Hello&quot;&gt;Hello World, Click Me!&lt;/string&gt;
&lt;string name=&quot;ApplicationName&quot;&gt;MonoAndroidApplication6&lt;/string&gt;
&lt;string name=&quot;One&quot; xml:space=&quot;preserve&quot;&gt; 1 &lt;/string&gt;
&lt;string name=&quot;Two&quot; xml:space=&quot;preserve&quot;&gt; 2 &lt;/string&gt;
&lt;string name=&quot;Three&quot; xml:space=&quot;preserve&quot;&gt; 3 &lt;/string&gt;
&lt;/resources&gt;
in the Activity add the following
button.Text = Resources.GetString(Resource.String.One) +
Resources.GetString(Resource.String.Two) +
Resources.GetString(Resource.String.Three);
you will see the text on the button is &quot;123&quot; not &quot; 1 2 3 &quot;.
I cannot replace with non-breaking spaces (ie. #a0;) since I need some words
to possibly wrap on these boundaries.
Is this a bug, is there a good workaround?
Cheers
Warren
--
View this message in context: <A HREF="http://mono-for-android.1047100.n5.nabble.com/Whitespace-not-being-respected-in-Strings-xml-tp5044196p5044196.html">http://mono-for-android.1047100.n5.nabble.com/Whitespace-not-being-respected-in-Strings-xml-tp5044196p5044196.html</A>
Sent from the Mono for Android mailing list archive at Nabble.com.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007485.html">[mono-android] intellisense in md with m4a
</A></li>
<LI>Next message: <A HREF="007468.html">[mono-android] Whitespace not being respected in Strings.xml?
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7465">[ date ]</a>
<a href="thread.html#7465">[ thread ]</a>
<a href="subject.html#7465">[ subject ]</a>
<a href="author.html#7465">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
mailing list</a><br>
</body></html>