Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow alternative placeholders for unknown characters #4

Open
epage opened this issue Mar 16, 2018 · 4 comments
Open

Allow alternative placeholders for unknown characters #4

epage opened this issue Mar 16, 2018 · 4 comments

Comments

@epage
Copy link

epage commented Mar 16, 2018

From the docs

Some Unicode characters are unknown and transliterate to "[?]".

In my use case, I already have a placeholder character. I'd rather not do a search/replace in strings for [?] in case a user has that. It'd be nice if I was given the option to set what the placeholder would be.

@kornelski
Copy link

In my fork I've made deunicode_char() return None instead of "[?]".

@epage
Copy link
Author

epage commented May 7, 2018

I think both would be useful.

@kornelski
Copy link

kornelski commented May 7, 2018

let custom_replacement = "?";
"string".chars().map(|c|deunicode_char(c).unwrap_or(custom_replacement)).collect::<String>()

@epage
Copy link
Author

epage commented Sep 7, 2018

I moved this over to kornelski#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants