gadomski / las-rs

Read and write ASPRS las files, Rust edition.
MIT License
73 stars 32 forks source link

Relaxes VLR text field parsing #31

Closed gadomski closed 4 years ago

gadomski commented 4 years ago

Though arguably non-ASCII text fields in the VLR header (user_id and description) are not within spec, we shouldn't barf if we come across them. This commit relaxes to allow non-ASCII text fields via a new as_las_string_lossy method. This method first tries to convert using the more restrictive as_las_str method, falling back on String::from_utf8_lossy if it's not valid text.

Closes #24.