Open lc-thomas opened 9 years ago
Here's my little (and dirty) workaround :
def smart_encode_str(s):
"""Create a UTF-16 encoded PDF string literal for s
."""
try:
utf16 = s.encode('utf_16_be')
except AttributeError: # ints and floats
utf16 = str(s).encode('utf_16_be')
safe = utf16.replace(b'\x00)', b'\x00)').replace(b'\x00(', b'\x00(').replace(b'\x00','')
return b''.join((codecs.BOM_UTF16_BE, safe))[2:]
Seems to still be an issue:
Is there a quick fix for this?
How does this look now that #16 was merged?
Forge_fdf generates weird characters in keys and values of the data I give it. Since it changes the keys, the output pdf forms aren't modified.
When manually removing these characters, it works very well.
Characters as seen by notepad++ :