Changeset 950 for libcaca/trunk/src


Ignore:
Timestamp:
May 9, 2006, 10:25:29 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Use UTF-8 instead of ANSI in cacaserver
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/cacaserver.c

    r896 r950  
    252252        /* Get ANSI representation of the image and skip the end-of buffer
    253253         * linefeed ("\r\n", 2 bytes) */
    254         server->buffer = cucul_export_canvas(server->canvas, "ansi");
     254        server->buffer = cucul_export_canvas(server->canvas, "utf8");
    255255        server->bufdata = cucul_get_buffer_data(server->buffer);
    256256        server->buflen = cucul_get_buffer_size(server->buffer);
     
    264264            if(send_data(server, &server->clients[i]))
    265265            {
    266                 fprintf(stderr, "client %i dropped connection\n",
     266                fprintf(stderr, "[%i] dropped connection\n",
    267267                                server->clients[i].fd);
    268268                close(server->clients[i].fd);
     
    310310        return;
    311311
    312     fprintf(stderr, "client %i connected from %s\n",
     312    fprintf(stderr, "[%i] connected from %s\n",
    313313                    fd, inet_ntoa(remote_addr.sin_addr));
    314314
     
    338338    if(send_data(server, &server->clients[server->client_count]))
    339339    {
    340         fprintf(stderr, "client %i dropped connection\n", fd);
     340        fprintf(stderr, "[%i] dropped connection\n", fd);
    341341        close(fd);
    342342        server->clients[server->client_count].fd = -1;
     
    375375                if(c->inbytes == 3)
    376376                {
    377                     fprintf(stderr, "client %i said: %.02x %.02x %.02x (%s %s %s)\n",
     377                    fprintf(stderr, "[%i] said: %.02x %.02x %.02x (%s %s %s)\n",
    378378                            c->fd, c->inbuf[0], c->inbuf[1], c->inbuf[2],
    379379                            COMMAND_NAME(c->inbuf[0]), COMMAND_NAME(c->inbuf[1]), OPTION_NAME(c->inbuf[2]));
     
    389389            if(c->inbuf[0] == 0x03)
    390390            {
    391                 fprintf(stderr, "client %i pressed C-c\n", c->fd);
     391                fprintf(stderr, "[%i] pressed C-c\n", c->fd);
    392392                return -1; /* User requested to quit */
    393393            }
     
    425425            else
    426426            {
    427                 fprintf(stderr, "client %i failed (%s)\n",
     427                fprintf(stderr, "[%i] failed (%s)\n",
    428428                        c->fd, strerror(errno));
    429429                return -1;
     
    477477        else
    478478        {
    479             fprintf(stderr, "client %i failed (%s)\n", c->fd, strerror(errno));
     479            fprintf(stderr, "[%i] failed (%s)\n", c->fd, strerror(errno));
    480480            return -1;
    481481        }
     
    509509        else
    510510        {
    511             fprintf(stderr, "client %i failed (%s)\n", c->fd, strerror(errno));
     511            fprintf(stderr, "[%i] failed (%s)\n", c->fd, strerror(errno));
    512512            return -1;
    513513        }
Note: See TracChangeset for help on using the changeset viewer.