diff --git a/crates/capri-core/src/lib.rs b/crates/capri-core/src/lib.rs new file mode 100644 index 0000000..ae4ed81 --- /dev/null +++ b/crates/capri-core/src/lib.rs @@ -0,0 +1,16 @@ +//! Shared foundations for Capri: XDG paths, settings, safe file I/O and the persona texts. +pub mod avatar; +pub mod fsutil; +pub mod paths; +pub mod persona; +pub mod settings; +pub mod store; + +pub use paths::Paths; +pub use settings::{Section, Settings}; +pub use store::SettingsStore; + +/// Length in UTF-16 code units, the unit Capri 1.0.4 used for every text limit. +pub fn utf16_len(s: &str) -> usize { + s.encode_utf16().count() +}