int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
{
	ASN1_STRING stmp, *str = &stmp;
	int mbflag, type, ret;
	if(!in) return -1;
	type = in->type;
	if((type < 0) || (type > 30)) return -1;
	mbflag = tag2nbyte[type];
	if(mbflag == -1) return -1;
	mbflag |= MBSTRING_FLAG;
	stmp.data = NULL;
	ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING);
	if(ret < 0) return ret;
	*out = stmp.data;
	return stmp.length;
}
['int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)\n{\n\tASN1_STRING stmp, *str = &stmp;\n\tint mbflag, type, ret;\n\tif(!in) return -1;\n\ttype = in->type;\n\tif((type < 0) || (type > 30)) return -1;\n\tmbflag = tag2nbyte[type];\n\tif(mbflag == -1) return -1;\n\tmbflag |= MBSTRING_FLAG;\n\tstmp.data = NULL;\n\tret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING);\n\tif(ret < 0) return ret;\n\t*out = stmp.data;\n\treturn stmp.length;\n}']