projects
/
g.raphael
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
daccb7b
)
fix raphael to svg with unicode
author
Alan Knowles
<alan@roojs.com>
Tue, 15 Dec 2020 08:47:24 +0000
(16:47 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 15 Dec 2020 08:47:24 +0000
(16:47 +0800)
seed/toSVG.js
patch
|
blob
|
history
diff --git
a/seed/toSVG.js
b/seed/toSVG.js
index
9d710a3
..
7cdfcb7
100644
(file)
--- a/
seed/toSVG.js
+++ b/
seed/toSVG.js
@@
-281,6
+281,20
@@
function toSVG() {
svg += '</svg>';
+
+ function U2A(str)
+ {
+ var ret = '';
+ for (var i = 0;i < str.length; i++) {
+ ret += str.charCodeAt(i) > 254 ? ('&#' + str.charCodeAt(i) + ';') : str.charAt(i);
+ }
+ return ret;
+ }
+
+ return U2A(svg);
+
+
+
return svg;
};
\ No newline at end of file