- Timestamp:
- Jan 17, 2008, 2:55:22 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 625802a
- Parents:
- 81312e4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
rb7b4565 r6fe806a 562 562 563 563 for (i = 1; i < bytes; i++) { 564 utf8buf[i] = wgetch(typwin); 565 } 566 if (g_utf8_validate(utf8buf, -1, NULL)) { 567 j.uch = g_utf8_get_char(utf8buf); 568 } 569 else { 570 j.ch = ERR; 571 } 564 int tmp = wgetch(typwin); 565 /* If what we got was not a byte, or not a continuation byte */ 566 if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) { 567 /* ill-formed UTF-8 code unit subsequence, put back the 568 char we just got. */ 569 ungetch(tmp); 570 j.ch = ERR; 571 break; 572 } 573 utf8buf[i] = tmp; 574 } 575 576 if (j.ch != ERR) { 577 if (g_utf8_validate(utf8buf, -1, NULL)) { 578 j.uch = g_utf8_get_char(utf8buf); 579 } 580 else { 581 j.ch = ERR; 582 } 583 } 572 584 } 573 585 else if (j.ch <= 0x7f) {
Note: See TracChangeset
for help on using the changeset viewer.