Rev 6262 | Rev 6471 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6262 | Rev 6462 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License. ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 6262 $ |
8 | $Revision: 6462 $ |
9 | 9 | ||
10 | 10 | ||
Line 389... | Line 389... | ||
389 | ret |
389 | ret |
Line 390... | Line 390... | ||
390 | 390 | ||
391 | .unk: |
391 | .unk: |
392 | mov al, '_' |
392 | mov al, '_' |
- | 393 | ret |
|
- | 394 | ||
- | 395 | utf8_to_cp866: |
|
- | 396 | ; in: esi, edi, ecx |
|
- | 397 | ; destroys esi, edi, ecx, eax |
|
- | 398 | call utf8to16 |
|
- | 399 | js utf8to16.ret |
|
- | 400 | call uni2ansi_char |
|
- | 401 | stosb |
|
- | 402 | jmp utf8_to_cp866 |
|
- | 403 | ||
- | 404 | utf8to16: |
|
- | 405 | ; in: |
|
- | 406 | ; esi -> string |
|
- | 407 | ; ecx = byte counter |
|
- | 408 | ; out: |
|
- | 409 | ; SF=1 -> end |
|
- | 410 | ; ax = UTF-16 char |
|
- | 411 | ; changes esi, ecx |
|
- | 412 | dec ecx |
|
- | 413 | js .ret |
|
- | 414 | lodsb |
|
- | 415 | test al, al |
|
- | 416 | jns .got |
|
- | 417 | shl al, 2 |
|
- | 418 | jnc utf8to16 |
|
- | 419 | @@: |
|
- | 420 | shl ax, 8 |
|
- | 421 | dec ecx |
|
- | 422 | js .ret |
|
- | 423 | lodsb |
|
- | 424 | test al, al |
|
- | 425 | jns .got |
|
- | 426 | shl al, 2 |
|
- | 427 | jc @b |
|
- | 428 | shr ah, 2 |
|
- | 429 | shl ax, 3 |
|
- | 430 | jnc @f |
|
- | 431 | shl eax, 3 |
|
- | 432 | dec ecx |
|
- | 433 | js .ret |
|
- | 434 | lodsb |
|
- | 435 | test al, al |
|
- | 436 | jns .got |
|
- | 437 | shl al, 2 |
|
- | 438 | jc @b |
|
- | 439 | shr eax, 2 |
|
- | 440 | ret |
|
- | 441 | ||
- | 442 | @@: |
|
- | 443 | shr ax, 5 |
|
- | 444 | ret |
|
- | 445 | ||
- | 446 | .got: |
|
- | 447 | xor ah, ah |
|
- | 448 | .ret: |
|
- | 449 | ret |
|
- | 450 | ||
- | 451 | strlen: |
|
- | 452 | ; in: esi -> source |
|
- | 453 | ; out: ecx = length |
|
- | 454 | push edi eax |
|
- | 455 | or ecx, -1 |
|
- | 456 | mov edi, esi |
|
- | 457 | xor eax, eax |
|
- | 458 | repnz scasb |
|
- | 459 | inc ecx |
|
- | 460 | not ecx |
|
- | 461 | pop eax edi |