Nelson Bolyard wrote:

Damiano ALBANI wrote:

 > Furthermore, if I feed addbuiltin with non-ASCII characters for the name
 > of the certificate, the name gets wrong : '�' (e acute) becomes 'é' for
                                             ^                     ^^
                                        ISO-Latin-1               UTF-8
                                          e acute                e acute

It may be instructive to look at your previous message (to which this
is a reply) in mozilla in different character sets.  If you select
View->Character Set->UTF8, you will see an e acute for the second part
above, and the first part will show as a question mark (indicating invalid
UTF8 character).  The e acute character takes up two bytes in UTF8.
If you view the UTF8 two-byte character in some other character set,
such as ISO-Latin-1, those two bytes are each interpreted as individual
Latin-1 characters, looking like an A with enya, and a copyright symbol
(at least on my screen).

So, what's happening in this case is that the e acute that you type onto
the command line is being converted to UTF8 properly, somewhere, but some
later piece of code is handling it as if it was two separate Latin-1
characters, rather than as a single two-byte UTF8 character.

My questions are:
1. where is the e acute character getting converted to UTF8 the first time?

I have no idea if it is converted to UTF8, I just used non-ASCII characters in the cert's nickname.


2. What was the binary/hex form of the character that addbuiltin received
from the command line?
When addbuiltin parsed the command line, were those two bytes there at
that time? Was the e acute character already in UTF8 form inside argv?
Was it UTF8 on the command line?

Using hexedit on certdata.txt, I saw that '�' characters are encoded as 'C3 E9'. It is UTF-8, isn't it ?


3. What is the LOCALE (environment variable) in your Linux environment?

I am on a Fedora Core 1, with : LANG=fr_FR.UTF-8 LANGVAR=fr_FR.UTF-8 SUPPORTED=fr_FR.UTF-8:fr_FR:fr (but no $LOCALE by the way)

Please try this experiment on your linux box:

Type this command

echo '�' | od -cx

Please type that command, just as you typed that character for addbuiltin.
Do not copy-n-paste it.  Then do copy-n-paste the output from that od
command into a followup message.

I got :


0000000 303 251  \n \0
        a9c3 000a
0000003

(A bit strange by the way, here a9 c3, above c3 a9...)

--
Damiano
_______________________________________________
mozilla-crypto mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-crypto

Reply via email to