code: function SurrogateAwareString(str) {
      this.str = str;
      this.index_mapping = [];
  
      for (var pos = 0; pos < str.length; pos++) {
          var ch = str.charAt(pos);
          this.index_mapping.push(pos);
          if (SurrogateAwareString.isSurrogatePair(ch)) {
              pos++;
          }
      }
      // Surrogate aware length
      this.length = this.index_mapping.length;
  }
docs: String wrapper for UTF-16 surrogate pair (4 bytes)
  @param {string} str String to wrap
  @constructor