chaokunyang commented on PR #1999:
URL: https://github.com/apache/fury/pull/1999#issuecomment-2577823419
> @chaokunyang Maybe,This feature is already implemented in `string_util.cc`
>
> ```c++
> bool isLatin(const std::string &str) {
> const char *data = str.data();
> size_t len = str.size();
>
> size_t i = 0;
> uint8x16_t latin_mask = vdupq_n_u8(0x80);
> for (; i + 16 <= len; i += 16) {
> uint8x16_t chars = vld1q_u8(reinterpret_cast<const uint8_t *>(data +
i));
> uint8x16_t result = vandq_u8(chars, latin_mask);
> if (vmaxvq_u8(result) != 0) {
> return false;
> }
> }
>
> for (; i < len; ++i) {
> if (static_cast<unsigned char>(data[i]) >= 128) {
> return false;
> }
> }
>
> return true;
> }
> ```
I missed that, it's named as `isLatin`, it should be renamed to `isASCII`.
Latin1 is superset of ascii
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]