Count byte length of string
It would be a lot simpler to work out the length yourself rather than to interpret the results of encodeURI().
/**
 * Count bytes in a string's UTF-8 representation.
 *
 * @param   string
 * @return  int
 */
function getByteLen(normal_val) {
    // Force string type
    normal_val = String(normal_val);

    var byteLen = 0;
    for (var i = 0; i &lt; normal_val.length; i++) {
        var c = normal_val.charCodeAt(i);
        byteLen += (c &amp; 0xf800) == 0xd800 ? 2 :  // Code point is half of a surrogate pair
                   c &lt; (1 &lt;&lt;  7) ? 1 :
                   c &lt; (1 &lt;&lt; 11) ? 2 : 3;
    }
    return byteLen;
}

JavaScript implementations may use either UCS-2 or UTF-16 to represent strings.
UCS-2 only supports Unicode code points up to U+FFFF, and such Unicode characters occupy 1, 2, or 3 bytes in their UTF-8 representation.  This is not too tricky to handle.
However, as @Mac points out, UTF-16 surrogate pairs are a tricky special case.  UTF-16 extends UCS-2 by adding support for code points U+10000 to U+10FFFF, which UTF-16 encodes using a pair of code points.  The first code point of such a pair (called the &quot;high surrogate&quot;) is in the range D800 to DBFF; it should always be followed by another code point (called the &quot;low surrogate&quot;) is in the range DC00 to DFFF.  Observe that the UTF-8 representation of any character in the range U+10000 to U+10FFFF would take 4 bytes.  Therefore, any surrogate pair in UTF-16 would translate to a 4-byte UTF-8 representation.  Or, we could say that whenever we encounter half of a surrogate pair (i.e., a code point is in the range from D800 to DFFF), just add two bytes to the UTF-8 length.