From 8412dfe204a780961c703b2f80ac885233474b31 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 10 May 2018 15:14:38 +0800 Subject: [PATCH] String.js --- String.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/String.js b/String.js index d53325392c..e2bdfe904f 100644 --- a/String.js +++ b/String.js @@ -67,6 +67,20 @@ var s = String.format('
{1}
', cls, text); return Roo.util.Format.htmlEncode(args[i]); }); } + function unicodeClean() { + return this.replace(/[\s\S]/g, function(character) { + if (character.charCodeAt()< 256) { + return character; + } + try { + encodeURIComponent(character); + } catch(e) { + return ''; + } + return character; + }); + + }); /** -- 2.39.2