crud/messageEndpoint.js
// Returns the byte length of a UTF-8 string
Returns the byte length of a UTF-8 string
Returns the byte length of a UTF - 8 string
function byte_length(str) {
      var s = str.length;
      for (var i=str.length-1; i>=0; i--) {
        var code = str.charCodeAt(i);
        if (code > 0x7f && code <= 0x7ff) {
          s++;
        } else if (code > 0x7ff && code <= 0xffff) {
          s+=2;
        }
        if (code >= 0xDC00 && code <= 0xDFFF) {
          i--; 
        }
      }
      return s;
    }
function byte_length ( str ) { var s = str . length ; for ( var i = str . length - 1 ; i >= 0 ; i -- ) { var code = str . charCodeAt ( i ) ; if ( code > 0x7f && code <= 0x7ff ) { s ++ ; } else if ( code > 0x7ff && code <= 0xffff ) { s += 2 ; } if ( code >= 0xDC00 && code <= 0xDFFF ) { i -- ; } } return s ; }
Returns the byte length of a UTF-8 string
Returns the byte length of a UTF - 8 string
//trail surrogate