| 587 | |
| 588 | |
| 589 | int Encoding_MapIniSetting ( BOOL bLoad, int iSetting ) |
| 590 | { |
| 591 | if ( bLoad ) { |
| 592 | switch ( iSetting ) { |
| 593 | case 0: |
| 594 | return CPI_DEFAULT; |
| 595 | case 1: |
| 596 | return CPI_UNICODEBOM; |
| 597 | case 2: |
| 598 | return CPI_UNICODEBEBOM; |
| 599 | case 3: |
| 600 | return CPI_UTF8; |
| 601 | case 4: |
| 602 | return CPI_UTF8SIGN; |
| 603 | case 5: |
| 604 | return CPI_OEM; |
| 605 | case 6: |
| 606 | return CPI_UNICODE; |
| 607 | case 7: |
| 608 | return CPI_UNICODEBE; |
| 609 | case 8: |
| 610 | return CPI_UTF7; |
| 611 | default: { |
| 612 | int i; |
| 613 | for ( i = CPI_UTF7 + 1; i < COUNTOF ( mEncoding ); i++ ) { |
| 614 | if ( mEncoding[i].uCodePage == ( UINT ) iSetting && Encoding_IsValid ( i ) ) { |
| 615 | return ( i ); |
| 616 | } |
| 617 | } |
| 618 | return CPI_DEFAULT; |
| 619 | } |
| 620 | } |
| 621 | } else { |
| 622 | switch ( iSetting ) { |
| 623 | case CPI_DEFAULT: |
| 624 | return 0; |
| 625 | case CPI_UNICODEBOM: |
| 626 | return 1; |
| 627 | case CPI_UNICODEBEBOM: |
| 628 | return 2; |
| 629 | case CPI_UTF8: |
| 630 | return 3; |
| 631 | case CPI_UTF8SIGN: |
| 632 | return 4; |
| 633 | case CPI_OEM: |
| 634 | return 5; |
| 635 | case CPI_UNICODE: |
| 636 | return 6; |
| 637 | case CPI_UNICODEBE: |
| 638 | return 7; |
| 639 | case CPI_UTF7: |
| 640 | return 8; |
| 641 | default: |
| 642 | return ( mEncoding[iSetting].uCodePage ); |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 |
no test coverage detected