After checked again, I think this may be a bug when xwiki render the
document. And it had appeared in earlier version.It is the same problem with
http://www.nabble.com/Non-ascii-characters-in-doc-names%2C-need-advices-for…
But in earlier version it had been fixed. In new version, because the
rendering architecture changed, it appeared again.
I checked com.xpn.xwiki.render.XWikiWikiBaseRenderer, and found this
function
public static void internalLink(StringBuffer output, String start, String
web, String topic,
String link, String anchor, boolean
doLink, XWikiContext context, Util util) {
// kill spaces and Wikify page name (ManpreetSingh - 15 Sep 2000)
topic = util.substitute("s/^\\s*//", topic);
topic = util.substitute("s/\\s*$//", topic);
topic = util.substitute("s/^(.)/\\U$1/", topic);
topic = util.substitute("s/\\s([a-zA-Z0-9])/\\U$1/g", topic);
// Add <nop> before WikiWord inside text to prevent double links
link =
util.substitute("s/(\\s)([A-Z]+[a-z]+[A-Z])/$1<nop>$2/go",
link);
// Parent Document
XWikiDocument parentdoc = (XWikiDocument) context.get("doc");
XWiki xwiki = context.getWiki();
XWikiDocument doc;
try {
doc = xwiki.getDocument(web, topic, context);
} catch (XWikiException e) {
doc = new XWikiDocument();
doc.setName(topic);
doc.setSpace(web);
}
output.append(start);
if (!doc.isNew()) {
output.append(" \""); ");
output.append(link);
output.append(" ");
} else if (doLink) {
output.append("");
output.append(link);
output.append(" \""); ? ");
} else {
output.append(link);
}
}
see lines
output.append(doc.getURL("edit", context));
output.append("?parent=");
output.append(parentdoc.getFullName());
The doc.getURL function internally use URLEncode to encod the main part of
teh URL, but URLEncode function doesn't been applied to the parent param.
And this cause two encodings in one URL.
I also think that other encoding problems is soemthing related with this
one.
Since I have only start XWiki for less than 2 months and I have few
knowledge about the XWiki source, so maybe I'm wrong.
But I hope someone can help me , because this problem is very critical to my
wiki.
--
View this message in context:
http://www.nabble.com/Encoding-problem-of-UTF-8-wiki%2C-especially-with-non…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.