From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
Added a method to utils to check
if a given field value is ASCII
Signed-off-by: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
---
ui/js/src/wok.utils.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js
index e5701e6..d7dd8a3 100644
--- a/ui/js/src/wok.utils.js
+++ b/ui/js/src/wok.utils.js
@@ -193,3 +193,7 @@ wok.urlSafeB64Decode = function(str) {
wok.urlSafeB64Encode = function(str) {
return $.base64.btoa(str, true).replace(/\+/g, '-').replace(/\//g,
'_');
}
+
+wok.isASCII = function(field) {
+ return /^[\x00-\x7F]*$/.test(field);
+}
--
2.1.0