🛠Lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
1.98k
stars
147
forks
source link
Strings::toAscii inconsistent "fallback" behavior #234
Closed
cniry closed 4 years ago
Version: 3.1
Bug Description
Strings::toAscii inconsistent "fallback" behavior causes it to silently break my data under certain circumstances.
Strings::toAscii si trying to use a)
Transliterator
b)iconv
c) it try to "at least remove non-ascii chars", which is very ugly fallbackProblematic lines: https://github.com/nette/utils/blob/v3.1/src/Utils/Strings.php#L191
Steps To Reproduce
Run it with missing Transliterator and iconv.
Expected Behavior
It shoud throw notice/exception because it is not able to work correctly. Not do it in the mode "eat my data".
Possible Solution
It shoud throw notice/exception because it is not able to work correctly. Not do it in the mode "eat my data".