diff --git a/Cargo.lock b/Cargo.lock index 218ed6e..8fe1611 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -100,7 +100,7 @@ dependencies = [ [[package]] name = "artimonist" -version = "1.6.1" +version = "1.6.2" dependencies = [ "anyhow", "artimonist 1.3.1", @@ -111,6 +111,7 @@ dependencies = [ "inquire", "predicates", "thiserror", + "unicode-normalization", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d9f9bd4..01bdcc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artimonist" -version = "1.6.1" +version = "1.6.2" edition = "2024" description = "A tool for generating mnemonics and wallets." @@ -28,6 +28,7 @@ comfy-table = { version = "^7.1.4", default-features = false } bip38 = "1.1.1" thiserror = "2.0.11" anyhow = "1.0.98" +unicode-normalization = "0.1.24" [profile.release] codegen-units = 1 diff --git a/src/diagram/execute.rs b/src/diagram/execute.rs index ea442bd..f39b40b 100644 --- a/src/diagram/execute.rs +++ b/src/diagram/execute.rs @@ -1,7 +1,6 @@ use super::{DiagramCommand, matrix::LoadMatrix, output::ConsoleOutput}; use crate::utils::{inquire_password, select_language}; use artimonist::{ComplexDiagram, Language, Matrix, SimpleDiagram}; -// use artimonist::{ComplexDiagram, Language, Matrix, SimpleDiagram}; impl crate::Execute for DiagramCommand { fn execute(&mut self) -> anyhow::Result<()> { diff --git a/src/diagram/output.rs b/src/diagram/output.rs index bad2456..525fdbe 100644 --- a/src/diagram/output.rs +++ b/src/diagram/output.rs @@ -3,6 +3,7 @@ use crate::utils::{bip38_encrypt, unicode_encode}; use anyhow::anyhow; use artimonist::{BIP85, ComplexDiagram, GenericDiagram, Matrix, SimpleDiagram, Xpriv}; use std::io::{BufWriter, Write}; +use unicode_normalization::UnicodeNormalization; pub trait ConsoleOutput: GenericDiagram { fn matrix(&self) -> &Matrix; @@ -25,7 +26,8 @@ pub trait ConsoleOutput: GenericDiagram { // generation results let password = cmd.password.as_ref().ok_or(anyhow!("empty password"))?; - let master = self.bip32_master(password.as_bytes())?; + let pass_nfc: String = password.nfc().collect(); + let master = self.bip32_master(pass_nfc.as_bytes())?; cmd.derive_all(&master, f)?; Ok(())