Skip to content

Commit 70a8ed1

Browse files
author
fangq
committed
allow \uXXXX to represent a unicode in a string
git-svn-id: http://svn.code.sf.net/p/iso2mesh/code/trunk/jsonlab@481 786e58fb-9377-0410-9ff7-e4ac0ac0635c
1 parent ff933c9 commit 70a8ed1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

savejson.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,11 @@
465465
for i=1:length(escapechars);
466466
newstr=regexprep(newstr,escapechars{i},escapechars{i});
467467
end
468+
newstr=regexprep(newstr,'\\\\(u[0-9a-fA-F]{4}[^0-9a-fA-F]*)','\$1');
468469
else
469470
escapechars={'\\','\"','\/','\a','\b','\f','\n','\r','\t','\v'};
470471
for i=1:length(escapechars);
471472
newstr=regexprep(newstr,escapechars{i},regexprep(escapechars{i},'\\','\\\\'));
472473
end
474+
newstr=regexprep(newstr,'\\\\(u[0-9a-fA-F]{4}[^0-9a-fA-F]*)','\\$1');
473475
end

0 commit comments

Comments
 (0)