summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar fab <fabrice.leal.ch@gmail.com>2018-11-30 23:29:14 +0000
committerGravatar fab <fabrice.leal.ch@gmail.com>2018-11-30 23:29:14 +0000
commit5cc729b48aad084757a049b7e5cdbadae5e9e400 (patch)
treec270cb8fc4ba70b731f514d201cda1e2b9120c5d /lib
parent7165ff3ae62930d735894b8f3a55e910082800cf (diff)
reject invalid codepoints. Basis.iscodepoint. fix german char in js
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js7
-rw-r--r--lib/ur/basis.urs2
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index de1a2ad0..c7725e28 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -38,7 +38,12 @@ function isXdigit(c) { return isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A'
function ord(c) { return c.charCodeAt(0); }
function isPrint(c) { return ord(c) > 31 && ord(c) != 127; }
function toLower(c) { return c.toLowerCase(); }
-function toUpper(c) { return c.toUpperCase(); }
+function toUpper(c) {
+ if (ord(c) == 223)
+ return c;
+ else
+ return c.toUpperCase();
+}
// Lists
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs
index 878f2793..c9d6556b 100644
--- a/lib/ur/basis.urs
+++ b/lib/ur/basis.urs
@@ -79,6 +79,8 @@ val toupper : char -> char
val ord : char -> int
val chr : int -> char
+val iscodepoint : int -> bool
+
(** String operations *)
val strlen : string -> int