Unable to find the number of Chinese characters of the string correctly

wrote a function to calculate the number of characters in the input string. When checking whether there is a Chinese character, there is a problem. After entering a string and entering two Chinese characters successively, the second Chinese character will be counted as 1 character.
the output result is as follows:

clipboard.png

here is the code for the check section

 function find(){
            var oform = document.forms[0];
            var msg = oform.elements["msg"].value;
            var sum = 0 ;
            var reg = new RegExp("[\\u4e00-\\u9fa5]","g");
            for(var i = 0; i < msg.length; iPP){
                if(reg.test(msg[i])){
                    sum += 2;
                }else {
                    sum PP;
                }
            }
            console.log(sum);
        }
``
Mar.01,2021

var reg = new RegExp ("[\\ u4e00 -\\ u9fa5]", "g");
change to

var reg = new RegExp("[\\u4e00-\\u9fa5]");
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ea5-2b924.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ea5-2b924.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?