/* These functions take a string in UTF8, ASCII or multibyte form and a mask of permissible ASN1 string types. It then works out the minimal type (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and creates a string of the correct type with the supplied data. Yes this is horrible: it has to be :-( The 'ncopy' form checks minimum and maximum size limits too.  */
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask)
/* These functions take a string in UTF8, ASCII or multibyte form and a mask of permissible ASN1 string types. It then works out the minimal type (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and creates a string of the correct type with the supplied data. Yes this is horrible: it has to be :-( The 'ncopy' form checks minimum and maximum size limits too.  */
int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask)
{
    return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
}