DXF Unicode Decoder
The DXF format uses a special form of unicode encoding: “\U+xxxx”.
To avoid a speed penalty such encoded characters are not decoded
automatically by the regular loading function:func:ezdxf.readfile,
only the recover module does the decoding
automatically, because this loading mode is already slow.
This kind of encoding is most likely used only in older DXF versions, because
since DXF R2007 the whole DXF file is encoded in utf8 and a special unicode
encoding is not necessary.
The ezdxf.has_dxf_unicode() and ezdxf.decode_dxf_unicode() are
new support functions to decode unicode characters “\U+xxxx” manually.
- ezdxf.has_dxf_unicode(s: str) bool
Returns
Trueif string s contains\U+xxxxencoded characters.
- ezdxf.decode_dxf_unicode(s: str) str
Decode
\U+xxxxencoded characters.