On 06/05/2013 02:47 PM, Thomas Gries wrote:
*Both *are not suited for my case, when $outertext has this " " character in it.
I'm not totally clear what you mean. Is the actual string like 'foo bar  '? If so, where is this string coming from? Ideally, this should not be in the string to begin with (escape at the last minute).
Or, do you mean there's an actual non-breaking space (what ' ' expands to) in the string? As far as I know, that doesn't need to be escaped.
After looking around in class Html and class Xml I found, that some of the methods use $wgContLang->normalize( $string ), and this works for me, too.
As noted, this is not correct. It cleans up Unicode-encoded text. It does not escape HTML.
If you really need to have the string ' ' in the input, and can't fix that, try Tyler's suggestion.
Matt Flaschen