mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 01:26:39 +00:00
Graphs: Import Data reads UTF-16 text files without a byte-order mark
The Graph Data window's Import Data read UTF-16 only after a byte-order mark, so a UTF-16 file without one filled the cells with NUL characters. It now reads such a file in the byte order Import Data Sets' rule (#7348) gives it: at least half of the two-byte units hold a NUL byte, and the byte order is the one that reads the line breaks. The text is then read as after a byte-order mark: an odd last byte is dropped and an unpaired surrogate reads as U+FFFD. A file the rule refuses is read as UTF-8, as before. The rule now also gives a byte order to a one-line file, which reads a line break in neither order: big-endian when more of its units start with a NUL byte than end with one, else little-endian as before. Import Data Sets still refuses a one-line file, which has no data rows; read in the new order, such a file can be refused with a different error first.
This commit is contained in:
@@ -26,6 +26,7 @@ use super::{CommandSpec, EngineError, Result, Session, bad, bool_or, checked_ids
|
||||
mod csv;
|
||||
mod library;
|
||||
|
||||
pub use csv::utf16_order_without_mark;
|
||||
use csv::{MAX_GRAPH_CSV, dataset_export, dataset_import};
|
||||
pub(crate) use library::{give_svg_library, svg_library};
|
||||
use library::{load_library, save_library};
|
||||
|
||||
Reference in New Issue
Block a user