static chooseMode(content, encoding = null) {
        if (CharacterSetECI.SJIS.getName() === encoding && this.isOnlyDoubleByteKanji(content)) {
            // Choose Kanji mode if all input are double-byte characters
            return Mode.KANJI;
        }
        let hasNumeric = false;
        let hasAlphanumeric = false;
        for (let i = 0, length = content.length; i < length; ++i) {
            const c = content.charAt(i);
            if (Encoder.isDigit(c)) {
                hasNumeric = true;
            }
            else if (this.getAlphanumericCode(c.charCodeAt(0)) !== -1) {
                hasAlphanumeric = true;
            }
            else {
                return Mode.BYTE;
            }
        }
        if (hasAlphanumeric) {
            return Mode.ALPHANUMERIC;
        }
        if (hasNumeric) {
            return Mode.NUMERIC;
        }
        return Mode.BYTE;
    }
/**
     * Choose the best mode by examining the content. Note that 'encoding' is used as a hint;
     * if it is Shift_JIS, and the input is only double-byte Kanji, then we return {@link Mode#KANJI}.
     */
Choose the best mode by examining the content. Note that 'encoding' is used as a hint;
if it is Shift_JIS, and the input is only double-byte Kanji, then we return  Mode#KANJI.
Choose the best mode by examining the content . Note that ' encoding ' is used as a hint ; if it is Shift_JIS and the input is only double - byte Kanji then we return Mode#KANJI .
static chooseMode(content, encoding = null) {
        if (CharacterSetECI.SJIS.getName() === encoding && this.isOnlyDoubleByteKanji(content)) {
            return Mode.KANJI;
        }
        let hasNumeric = false;
        let hasAlphanumeric = false;
        for (let i = 0, length = content.length; i < length; ++i) {
            const c = content.charAt(i);
            if (Encoder.isDigit(c)) {
                hasNumeric = true;
            }
            else if (this.getAlphanumericCode(c.charCodeAt(0)) !== -1) {
                hasAlphanumeric = true;
            }
            else {
                return Mode.BYTE;
            }
        }
        if (hasAlphanumeric) {
            return Mode.ALPHANUMERIC;
        }
        if (hasNumeric) {
            return Mode.NUMERIC;
        }
        return Mode.BYTE;
    }
static chooseMode ( content , encoding = null ) { if ( CharacterSetECI . SJIS . getName ( ) === encoding && this . isOnlyDoubleByteKanji ( content ) ) { return Mode . KANJI ; } let hasNumeric = false ; let hasAlphanumeric = false ; for ( let i = 0 , length = content . length ; i < length ; ++ i ) { const c = content . charAt ( i ) ; if ( Encoder . isDigit ( c ) ) { hasNumeric = true ; } else if ( this . getAlphanumericCode ( c . charCodeAt ( 0 ) ) !== - 1 ) { hasAlphanumeric = true ; } else { return Mode . BYTE ; } } if ( hasAlphanumeric ) { return Mode . ALPHANUMERIC ; } if ( hasNumeric ) { return Mode . NUMERIC ; } return Mode . BYTE ; }
Choose the best mode by examining the content.
Choose the best mode by examining the content .
// Choose Kanji mode if all input are double-byte characters