Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
SemWeb
libview
Commits
c43416eaab2e
Commit
4de74628
authored
Nov 14, 2018
by
Laurent Wouters
Browse files
[fix] Fixing issue with URI handling
parent
c95c5239e5b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
libview/src/application.ts
View file @
c43416ea
...
...
@@ -31,15 +31,22 @@ function uriUnicodeEscape(uri: string): string {
if
(
cc
>=
0x80
)
{
let
offset
=
cc
>=
0xd800
&&
cc
<=
0xdbff
?
1
:
0
;
let
cp
=
uri
.
codePointAt
(
i
);
let
cpAsString
=
cp
===
undefined
?
""
:
cp
.
toString
(
16
).
toUpperCase
();
result
+=
"
\\
u
"
;
let
leading
=
4
+
offset
*
4
-
cpAsString
.
length
;
while
(
leading
>
0
)
{
result
+=
"
0
"
;
leading
--
;
if
(
cp
===
undefined
)
{
console
.
log
(
"
Failed to identify codepoint at
"
+
i
+
"
in '
"
+
uri
+
'
"
'
);
i
+=
1
;
}
else
{
let
cpAsString
=
cp
.
toString
(
16
).
toUpperCase
();
result
+=
"
\\
u
"
;
let
leading
=
4
+
offset
*
4
-
cpAsString
.
length
;
while
(
leading
>
0
)
{
result
+=
"
0
"
;
leading
--
;
}
result
+=
cpAsString
;
i
+=
offset
;
}
result
+=
cp
;
i
+=
offset
;
}
else
{
result
+=
uri
.
charAt
(
i
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment