Ignore:
Timestamp:
Jun 18, 2008, 11:42:50 PM (12 years ago)
Author:
Pascal Terjan
Message:
  • Oops revert parts of 2451 which should not have been commited
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/term.c

    r2451 r2453  
    344344        {
    345345            unsigned int bytes;
    346             char tmp[7];
    347346
    348347            if(i + 6 < size)
     
    351350            {
    352351                /* Add a trailing zero to what we're going to read */
     352                char tmp[7];
    353353                memcpy(tmp, buffer + i, size - i);
    354354                tmp[size - i] = '\0';
    355355                ch = cucul_utf8_to_utf32(tmp, &bytes);
    356356            }
    357             /* FIXME awful for perfs
    358                should get a better way to know if utf8 was valid */
    359             memset(tmp, 0, 7);
    360             cucul_utf32_to_utf8(tmp, ch);
    361             if(strncmp(tmp, (char const *)(buffer + i), strlen(tmp)))
    362                 bytes = 0;
     357
    363358            if(!bytes)
    364359            {
    365360                /* If the Unicode is invalid, assume it was latin1. */
    366361                ch = buffer[i];
    367                 debug("Invalid UTF-8 : %c", ch);
    368362                bytes = 1;
    369363            }
Note: See TracChangeset for help on using the changeset viewer.