diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 74ffad0f53ec63c57595a2f9da07c29ee56a88cd..7c925b889949b2683ec70037f55f6d70c9a02730 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2505,6 +2505,8 @@ void LLTextEditor::updateSegments()
 
 void LLTextEditor::updateLinkSegments()
 {
+	LLWString wtext = getWText();
+
 	// update any segments that contain a link
 	for (segment_set_t::iterator it = mSegments.begin(); it != mSegments.end(); ++it)
 	{
@@ -2514,13 +2516,13 @@ void LLTextEditor::updateLinkSegments()
 			// if the link's label (what the user can edit) is a valid Url,
 			// then update the link's HREF to be the same as the label text.
 			// This lets users edit Urls in-place.
-			LLUrlMatch match;
 			LLStyleSP style = static_cast<LLStyleSP>(segment->getStyle());
-			std::string url_label = getText().substr(segment->getStart(), segment->getEnd()-segment->getStart());
-			if (LLUrlRegistry::instance().findUrl(url_label, match))
+			LLWString url_label = wtext.substr(segment->getStart(), segment->getEnd()-segment->getStart());
+			if (LLUrlRegistry::instance().hasUrl(url_label))
 			{
-				LLStringUtil::trim(url_label);
-				style->setLinkHREF(url_label);
+				std::string new_url = wstring_to_utf8str(url_label);
+				LLStringUtil::trim(new_url);
+				style->setLinkHREF(new_url);
 			}
 		}
 	}
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 8413de0837d5d3c130a5f317c88590bf482bcd69..249c7320d698988de818771e03849c37a116a38c 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -192,3 +192,15 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
 	}
 	return false;
 }
+
+bool LLUrlRegistry::hasUrl(const std::string &text)
+{
+	LLUrlMatch match;
+	return findUrl(text, match);
+}
+
+bool LLUrlRegistry::hasUrl(const LLWString &text)
+{
+	LLUrlMatch match;
+	return findUrl(text, match);
+}
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index 85e934e4b5e839a9837f70285bfd43c548041cee..d7800d8cfc29606bb6c691a96a36d6fbe1f422fc 100644
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -81,6 +81,10 @@ public:
 	bool findUrl(const LLWString &text, LLUrlMatch &match,
 				 const LLUrlLabelCallback &cb = &LLUrlRegistryNullCallback);
 
+	// return true if the given string contains a URL that findUrl would match
+	bool hasUrl(const std::string &text);
+	bool hasUrl(const LLWString &text);
+
 private:
 	LLUrlRegistry();
 	friend class LLSingleton<LLUrlRegistry>;