[gnu.emacs.bug] ascii codes > 177 and process input

loic@design.axis.fr (Loic Dachary) (07/05/89)

In GNU Emacs 18.54.24 of Wed Jul  5 1989 on dsgn42 (usg-unix-v)

    
    Here is a small c program :

main()
{
    int a = 0;
    ((char *)(&a))[0] = '\200';
    ((char *)(&a))[1] = '\200';
    write(1, &a, sizeof(int));
}

   Compile it and run it in a shell buffer. You normally get the following
output :

\200^@^@

  Note that the first \200 is missing.

  If you run the following program :

main()
{
    int a = 0;
    write(1, "ab", 2);
    ((char *)(&a))[0] = '\200';
    ((char *)(&a))[1] = '\200';
    write(1, &a, sizeof(int));
}

    You get : ab\200\200^@^@ which is perfectly normal. 

    I can't find where this behaviour is documented, is there someone
on the net who can explain this ?

     Thanx in advance,
				Loic