diff options
Diffstat (limited to 'python/databuffer.py')
| -rw-r--r-- | python/databuffer.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/databuffer.py b/python/databuffer.py index 8a862872..8644a75e 100644 --- a/python/databuffer.py +++ b/python/databuffer.py @@ -37,6 +37,8 @@ class DataBuffer(object): elif isinstance(contents, DataBuffer): self.handle = core.BNDuplicateDataBuffer(contents.handle) else: + if bytes != str and isinstance(contents, str): + contents = contents.encode('charmap') self.handle = core.BNCreateDataBuffer(contents, len(contents)) def __del__(self): |
