-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escape vertical tab #31
Comments
something like this helps: yieldable-stringify.js let escape = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'\v': '\\u000B',
'"': '\\"',
}; |
@tschechniker - thanks for reporting this, I will look at this. |
by adding escape sequencing for vertical tab Add two unit tests to validate this scenario. Fixes: ibmruntimes#31
Both APIs fail when the key or value contain vertical tab. Fix that by adding escape sequencing for vertical tab Add two unit tests to validate this scenario. Fixes: ibmruntimes#31
Hello, I have the same problem with characters Unfortunately, I acquire strings from a 3rd party source that I need to parse, modify and re-stringify, so I also wonder if there are other possible cases, too? To clarify, in this example: const yj = require('yieldable-json');
const obj = { value: '\u0000' };
const str1 = JSON.stringify(obj);
console.log('str1: ' + str1);
yj.stringifyAsync(obj, (err, str2) => {
console.log('str2: ' + (str2));
const parsed = JSON.parse(str2);
console.log(parsed);
}); I get:
|
I'm also encountering this issue, whicih is making it unable to parse json. I would appreciate if this PR could be merged. |
Hi,
just came over this issue. If you have a string including a vertical tab the json is broken. We need to escape it. Could you please extend the escaping list and add "\v" to be escaped too?
Thanks!
Tobi
The text was updated successfully, but these errors were encountered: