ASCII

Jorge Severino jorge en opentrade.cl
Sab Sep 14 18:46:50 CLT 2002


grax..

----- Original Message -----
From: "Horst von Brand" <vonbrand en inf.utfsm.cl>
To: <bsd en inf.utfsm.cl>
Sent: Saturday, September 14, 2002 9:55 AM
Subject: Re: ASCII


> "Jorge Severino" <jorge en opentrade.cl> dijo:
> > copie el archivo /etc/hosts desde un freebsd a un windows 95 y al =
> > abrirlo me salio algo asi:
> >
> > 127.0.0.1 localhost||1.1.1.1  servidor||2.2.2.2  router||
> >
> > saben como puedo hacer para que el freebsd me transforme correctamente =
> > al ASCII del windows ?
>
> dos2unix(1), unix2dos(1) (Son +/- universales). O transformar '\n' en
> "\r\n" (es un programita C enfermo de picante, vamos...
>
> /*
>  * u2d.c -- Unix text to DOS text
>  *
>  * Horst von Brand <vonbrand en inf.utfsm.cl> 20020914
>  */
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main()
> {
>      int c;
>
>      while((c = getchar()) != EOF) {
>   if(c == '\n')
>        putchar('\r');
>   putchar(c);
>      }
>      exit(EXIT_SUCCESS);
> }
> --
> Dr. Horst H. von Brand                   User #22616 counter.li.org
> Departamento de Informatica                     Fono: +56 32 654431
> Universidad Tecnica Federico Santa Maria              +56 32 654239
> Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513