if (explicit) text->specified_kcode = text->kcode; else { if (UCAssume_MIMEcharset) { if (!strcmp(UCAssume_MIMEcharset, "euc-jp")) text->kcode = text->specified_kcode = EUC; else if (!strcmp(UCAssume_MIMEcharset, "shift_jis")) text->kcode = text->specified_kcode = SJIS; } }
PUBLIC void HText_setKcode ARGS3(	HText *,	text,	CONST char *,	charset,	LYUCcharset *,	p_in){    if (!text)	return;    /*    **  Check whether we have some kind of info. - kw    */    if (!charset && !p_in) {	return;    }    /*    **  If no explicit charset string, use the implied one. - kw    */    if (!charset || *charset == '\0') {	charset = p_in->MIMEname;    }    /*    **  Check whether we have a specified charset. - FM    */    if (!charset || *charset == '\0') {	return;    }    /*    **  We've included the charset, and not forced a download offer,    **  only if the currently selected character set can handle it,    **  so check the charset value and set the text->kcode element    **  appropriately. - FM    */    if (!strcmp(charset, "shift_jis") ||	!strcmp(charset, "x-shift-jis")) {	text->kcode = SJIS;    } else if ((p_in && (p_in->enc == UCT_ENC_CJK)) ||	       !strcmp(charset, "euc-jp") ||	       !strncmp(charset, "x-euc-", 6) ||	       !strcmp(charset, "iso-2022-jp") ||	       !strcmp(charset, "iso-2022-jp-2") ||	       !strcmp(charset, "euc-kr") ||	       !strcmp(charset, "iso-2022-kr") ||	       !strcmp(charset, "big5") ||	       !strcmp(charset, "cn-big5") ||	       !strcmp(charset, "euc-cn") ||	       !strcmp(charset, "gb2312") ||	       !strncmp(charset, "cn-gb", 5) ||	       !strcmp(charset, "iso-2022-cn")) {	text->kcode = EUC;    } else {	/*	**  If we get to here, it's not CJK, so disable that if	**  it is enabled.  But only if we are quite sure. - FM & kw	*/	text->kcode = NOKANJI;	if (HTCJK != NOCJK) {	    if (!p_in || p_in->enc != UCT_ENC_CJK)		HTCJK = NOCJK;	}    }    return;}