Re: X509_NAME_get_text_by_NID fails with accent?
Jostein Tveit wrote: Massimo Rando [EMAIL PROTECTED] writes: The function returns: i = 6 buf (hex) = 4d 61 72 69 c3 b2 but the buffer 'buf' should contain the given name 'Mariò' (hex: 4d 61 72 69 f2) while I find the string Mariò (hex: 4d 61 72 69 c3 b2). ò in UTF-8 is 0xc3 0xb2. ò in ISO-8859-1 is 0xf2. I guess the string is encoded as UTF8String in the certificate. If you want your output in ISO-8859-1, you have to convert it from UTF-8. thanks, I solved with a conversion from UTF8 __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]
X509_NAME_get_text_by_NID fails with accent?
Hello I have a problem with the function X509_NAME_get_text_by_NID. To get the last name of the subject of a certificate I use this call: i = X509_NAME_get_text_by_NID(X509_get_subject_name(x), NID_givenName, buf, lenbuf); usually it works fine but with this certificate (see the attachment) it fails returning the last character of the surname (ò). The function returns: i = 6 buf (hex) = 4d 61 72 69 c3 b2 but the buffer 'buf' should contain the given name 'Mariò' (hex: 4d 61 72 69 f2) while I find the string Mariò (hex: 4d 61 72 69 c3 b2). Thanks for your help. Massimo CertificatoAccento.cer Description: application/x509-ca-cert
Re: X509_NAME_get_text_by_NID fails with accent?
Massimo Rando [EMAIL PROTECTED] writes: The function returns: i = 6 buf (hex) = 4d 61 72 69 c3 b2 but the buffer 'buf' should contain the given name 'Mariò' (hex: 4d 61 72 69 f2) while I find the string Mariò (hex: 4d 61 72 69 c3 b2). ò in UTF-8 is 0xc3 0xb2. ò in ISO-8859-1 is 0xf2. I guess the string is encoded as UTF8String in the certificate. If you want your output in ISO-8859-1, you have to convert it from UTF-8. -- Jostein Tveit [EMAIL PROTECTED] __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]