code: function leftstr(text, limit){
          var substr = '';
          var count = 0;
          var char;
          for(var i=0,len=text.length;i<len;i++){
              char = text.charCodeAt(i);
              substr += text.charAt(i);
              count += char > 255 ? 2 : 1;
              if(count >= limit){
                  return substr;
              }
          }
          return substr;
      }
docs: 从左边读取限制长度的字符串