| 343 | |
| 344 | template<class STR> |
| 345 | static bool DoIsStringASCII(const STR& str) { |
| 346 | for (size_t i = 0; i < str.length(); i++) { |
| 347 | typename ToUnsigned<typename STR::value_type>::Unsigned c = str[i]; |
| 348 | if (c > 0x7F) |
| 349 | return false; |
| 350 | } |
| 351 | return true; |
| 352 | } |
| 353 | |
| 354 | bool IsStringASCII(const StringPiece& str) { |
| 355 | return DoIsStringASCII(str); |