Open verulian opened 1 year ago
All I changed in that section was the comment style. The code there is the same as it has been for a long time.
The comments are somewhat misleading... "western" just means ASCII codes, and the first 128 UTF-8 codes == ASCII codes.
I can't think of a reason why we would need an "is_western_chars_only" check.
I guess thinking of just the speed diff betwixt western and !western only for large iteration scenarios might be useful but I will close if this is nonsensical which seems you are indicating.
I don't know. If you have a valid use-case, please show it. All I said was I can't think of one.
Describe the feature
I noticed that @JalonSolov made some cleanup changes to https://github.com/vlang/v/blob/master/vlib/encoding/utf8/utf8_util.v about western-only encoding. Am I missing the logic here or are we missing a function like "
is_western_chars_only
" that would test a string to ensure that it is western only before performing operations? Initially hwen I look at this it seems the programmer needs to know if it is or should be this only, but it might be easier if this is used many times to have a simple test to ensure westernness of the string before performing operations.Use Case
If western-only operations are used multiple times it would be better to have a test available to ensure westernness of the variable in question vs depending on developer awareness. If it is a one-off this might not make sense, but if there are many it might make sense.
Proposed Solution
Parse/test string to ensure westernness or non-westernness.
Other Information
No response
Acknowledgements
Version used
current
Environment details (OS name and version, etc.)
n/a