Skip to content

Commit f6b0b03

Browse files
committed
Updated the doc with example of no_escape flag
1 parent 03b3957 commit f6b0b03

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rejson/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
jp.set('foo', 'bar')
4848
jp.jsonset('baz', Path.rootPath(), 'qaz')
4949
jp.execute()
50+
51+
# If you use non-ascii character in your JSON data, you can add the no_escape flag to JSON.GET command
52+
obj_non_ascii = {
53+
'non_ascii_string': 'hyvää'
54+
}
55+
56+
rj.jsonset('non-ascii', Path.rootPath(), obj_non_ascii)
57+
print '{} is a non-ascii string'.format(rj.jsonget('non-ascii', Path('.non_ascii_string'), no_escape=True))
5058
```
5159
5260
## Encoding/Decoding

0 commit comments

Comments
 (0)