qsu
Version:
qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.
1 lines • 146 B
JavaScript
export function getStrBytes(t){if(!t)return 0;let o=0;for(const e of t){const t=e.codePointAt(0);t&&(o+=t<=127?1:t<=2047?2:t<=65535?3:4)}return o}