Changeset 31418 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Aug 5, 2010 5:37:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r31246 r31418 64 64 { 65 65 /* figure sequence length and validate the first byte */ 66 /** @todo RT_USE_RTC_3629 */ 66 67 unsigned cb; 67 68 if ((uch & (RT_BIT(7) | RT_BIT(6) | RT_BIT(5))) == (RT_BIT(7) | RT_BIT(6))) … … 805 806 { 806 807 size_t cch = 0; 807 while (true)808 for (;;) 808 809 { 809 810 RTUNICP Cp; … … 814 815 if (RT_FAILURE(rc)) 815 816 return rc; 816 cchCp = RTStrCpSize(Cp); 817 if (cchCp == 0) 818 return VERR_NO_TRANSLATION; 819 cch += cchCp; 817 cch += RTStrCpSize(Cp); /* cannot fail */ 820 818 } 821 819 … … 838 836 static int rtLatin1RecodeAsUtf8(const char *pszIn, size_t cchIn, char *psz, size_t cch) 839 837 { 840 int rc = VINF_SUCCESS; 841 842 while (true) 838 int rc = VINF_SUCCESS; 839 for (;;) 843 840 { 844 841 RTUNICP Cp; … … 854 851 break; 855 852 } 853 cch -= cchCp; 856 854 psz = RTStrPutCp(psz, Cp); 857 cch -= cchCp;858 855 } 859 856 … … 985 982 986 983 /** 987 * Calculates the Latin-1 length of a string, validating the encoding while doing so. 984 * Calculates the Latin-1 length of a string, validating the encoding while 985 * doing so. 988 986 * 989 987 * @returns IPRT status code. … … 996 994 { 997 995 size_t cch = 0; 998 while (true)996 for (;;) 999 997 { 1000 998 RTUNICP Cp; … … 1033 1031 int rc = VINF_SUCCESS; 1034 1032 1035 while (true)1033 for (;;) 1036 1034 { 1037 1035 RTUNICP Cp; … … 1047 1045 break; 1048 1046 } 1047 cch -= cchCp; 1049 1048 psz = RTLatin1PutCp(psz, Cp); 1050 cch -= cchCp;1051 1049 } 1052 1050 … … 1224 1222 { 1225 1223 /* figure the length and validate the first octet. */ 1224 /** @todo RT_USE_RTC_3629 */ 1226 1225 unsigned cb; 1227 1226 if (!(uch & RT_BIT(5))) … … 1375 1374 { 1376 1375 /* figure the length and validate the first octet. */ 1376 /** @todo RT_USE_RTC_3629 */ 1377 1377 unsigned cb; 1378 1378 if (!(uch & RT_BIT(5))) … … 1500 1500 else if (uc < 0x00010000) 1501 1501 { 1502 /** @todo RT_USE_RTC_3629 */ 1502 1503 if ( uc < 0x0000d8000 1503 1504 || ( uc > 0x0000dfff … … 1514 1515 } 1515 1516 } 1517 /** @todo RT_USE_RTC_3629 */ 1516 1518 else if (uc < 0x00200000) 1517 1519 {
Note:
See TracChangeset
for help on using the changeset viewer.