diff -Naur terminal.orig/BasicTerminalBuffer.cpp terminal/BasicTerminalBuffer.cpp
old
|
new
|
|
558 | 558 | //(int)c.ByteCount(), c.bytes, c.bytes[0], attributes); |
559 | 559 | if ((int32)width == FULL_WIDTH) |
560 | 560 | attributes |= A_WIDTH; |
| 561 | else if (c.IsFullWidth()) |
| 562 | { |
| 563 | attributes |= A_WIDTH; |
| 564 | width = 2; |
| 565 | } |
561 | 566 | |
562 | 567 | if (fSoftWrappedCursor || fCursor.x + (int32)width > fWidth) |
563 | 568 | _SoftBreakLine(); |
diff -Naur terminal.orig/TermParse.cpp terminal/TermParse.cpp
old
|
new
|
|
376 | 376 | parsestate = groundtable; |
377 | 377 | currentEncoding = fBuffer->Encoding(); |
378 | 378 | } |
379 | | |
380 | 379 | //debug_printf("TermParse: char: '%c' (%d), parse state: %d\n", c, c, parsestate[c]); |
381 | | switch (parsestate[c]) { |
| 380 | int parsestatus = parsestate[c]; |
| 381 | if(currentEncoding == B_GBK_CONVERSION) |
| 382 | { |
| 383 | if ((c > 0xA1 && c < 0xA9) |
| 384 | || (c>0xB0 && c< 0xF7) |
| 385 | || (c>0x81 && c< 0xA0) |
| 386 | || (c>0xAA && c< 0xFE) |
| 387 | || (c>0xA8 && c< 0xA9)) |
| 388 | parsestatus = CASE_PRINT_GR; |
| 389 | } |
| 390 | switch (parsestatus) { |
382 | 391 | case CASE_PRINT: |
383 | 392 | fBuffer->InsertChar((char)c, fAttr); |
384 | 393 | break; |
… |
… |
|
425 | 434 | } |
426 | 435 | |
427 | 436 | srcLen = strlen(cbuf); |
| 437 | dstLen = 4; |
428 | 438 | if (currentEncoding != B_JIS_CONVERSION) { |
429 | 439 | convert_to_utf8(currentEncoding, cbuf, &srcLen, |
430 | 440 | dstbuf, &dstLen, &dummyState, '?'); |
diff -Naur terminal.orig/UTF8Char.h terminal/UTF8Char.h
old
|
new
|
|
57 | 57 | |
58 | 58 | bool IsFullWidth() const |
59 | 59 | { |
60 | | // TODO: Implement! |
61 | | return false; |
| 60 | return ((unsigned char)bytes[0] > 0xe0); |
62 | 61 | } |
63 | 62 | |
64 | 63 | bool IsSpace() const |