Properly unescape \t, \r, \n, \\.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@352 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
30e3ca4965
commit
47cad64a3f
@ -146,7 +146,18 @@ public class Scanner {
|
||||
} else if (c == '\\') {
|
||||
_index++; // skip escaping marker
|
||||
if (_index < _limit) {
|
||||
sb.append(_text.charAt(_index));
|
||||
char c2 = _text.charAt(_index);
|
||||
if (c2 == 't') {
|
||||
sb.append('\t');
|
||||
} else if (c2 == 'n') {
|
||||
sb.append('\n');
|
||||
} else if (c2 == 'r') {
|
||||
sb.append('\r');
|
||||
} else if (c2 == '\\') {
|
||||
sb.append('\\');
|
||||
} else {
|
||||
sb.append(c2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sb.append(c);
|
||||
|
Loading…
Reference in New Issue
Block a user