code: public int strLength(byte[]bytes, int p, int end) {
          int n = 0;
          int q = p;
          while (q < end) {
              q += length(bytes, q, end);
              n++;
          }
          return n;
      }
docs: /* onigenc_strlen