return byteCount / (ucnv_getMinCharSize(__pEncoder));
}
-result
-_IcuEncodingCore::GetAvailableEncodingsN(IList* pEncodingList)
-{
- SysTryReturnResult(NID_TEXT, pEncodingList, E_INVALID_ARG, "[%s] Invalid argument is used.Input encoding list is null", GetErrorMessage(E_INVALID_ARG));
-
- result r = E_SUCCESS;
- int count = ucnv_countAvailable();
- SysTryReturnResult(NID_TEXT, count > 0, E_SYSTEM, "[%s] Unable to get available encoding list count.", GetErrorMessage(E_SYSTEM));
-
- String* pEncodingStr = null;
- for (int i = 0; i < count; i++)
- {
- pEncodingStr = new (std::nothrow) String(ucnv_getAvailableName(i));
- SysTryReturnResult(NID_TEXT, pEncodingStr, E_OUT_OF_MEMORY, "[%s] Memory allocationfailed", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pEncodingList->Add(*pEncodingStr);
- if (IsFailed(r))
- {
- delete pEncodingStr;
- return r;
- }
- }
-
- for (int i = 0; i < EXTRA_ENCODINGS_LENGTH; i++)
- {
- pEncodingStr = new (std::nothrow) String(extraEncodings[i]);
- SysTryReturnResult(NID_TEXT, pEncodingStr, E_OUT_OF_MEMORY, "[%s] Memory allocationfailed", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pEncodingList->Add(*pEncodingStr);
- if (IsFailed(r))
- {
- delete pEncodingStr;
- return r;
- }
- }
-
- return E_SUCCESS;
-}
result
_IcuEncodingCore::GetResultFromIcuErrorCode(UErrorCode& err)