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

Non-existing character in an alphabet #3

Closed
tigertv opened this issue May 9, 2020 · 4 comments
Closed

Non-existing character in an alphabet #3

tigertv opened this issue May 9, 2020 · 4 comments

Comments

@tigertv
Copy link
Owner

tigertv commented May 9, 2020

Conclusions from #2:
Handle exceptions when a character doesn't exist in an alphabet.
A solution would be either to show an error message or remove non-existing characters from message.

@tigertv tigertv changed the title Show error message Non-existing character in an alphabet May 9, 2020
@tigertv tigertv added invalid This doesn't seem right and removed invalid This doesn't seem right labels May 9, 2020
tigertv added a commit that referenced this issue May 16, 2020
@tigertv tigertv closed this as completed May 16, 2020
@ZetaTwo
Copy link

ZetaTwo commented Nov 29, 2020

At least for Caesar it would be good to be able to just leave the character in place.

@tigertv
Copy link
Owner Author

tigertv commented Nov 29, 2020

Hi @ZetaTwo !

... just leave the character in place.

Developer decides how to handle the situation, he uses either a 'try-catch' or correct input(only characters from alphabet).
Also developer can use the wrappers 'SaveAll' and 'RemoveNonAlphabet' which save and remove non-alphabet characters correspondingly:

plaintext = "I love non-alphabet characters. These are : ^,&@$~(*;?&#. That's it!"
cm = SaveAll(cm0)
encdec(cm, plaintext)
plaintext = "I don't love non-alphabet characters. I will remove all of them: ^,&@$~(*;?&#. Great!"
cm = RemoveNonAlphabet(cm0)
encdec(cm, plaintext)

@ZetaTwo
Copy link

ZetaTwo commented Nov 29, 2020

Also developer can use the wrappers 'SaveAll' and 'RemoveAll'

Perfect. This was exactly what I was looking for. Thank you.

@tigertv
Copy link
Owner Author

tigertv commented Nov 29, 2020

You are welcome!

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