Lines Matching refs:srcLength

240 int TextCoder::Utf8ToGsm7bit(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, MSG_LANGUAGE_ID_T &langId)
242 if (srcLength == -1 && src) {
244 srcLength = strlen(reinterpret_cast<const gchar *>(src));
246 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
251 int maxUcs2Length = srcLength;
267 TELEPHONY_LOGI("srcLength = %{public}d", srcLength);
268 int ucs2Length = Utf8ToUcs2(reinterpret_cast<uint8_t *>(pUcs2Text), maxUcs2Length * sizeof(WCHAR), src, srcLength);
272 int TextCoder::Utf8ToUcs2(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength)
274 if (srcLength == -1 && src) {
276 srcLength = strlen(reinterpret_cast<gchar *>(const_cast<uint8_t *>(src)));
278 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
283 gsize textLen = static_cast<gsize>(srcLength);
296 int TextCoder::GsmUtf8ToAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength,
299 int maxUcs2Length = srcLength;
314 int ucs2Length = Utf8ToUcs2(reinterpret_cast<uint8_t *>(pUcs2Text), maxUcs2Length * sizeof(WCHAR), src, srcLength);
318 tempTextLen = (srcLength > maxLength) ? maxLength : srcLength;
343 int TextCoder::CdmaUtf8ToAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, DataCodingScheme &scheme)
345 int maxUcs2Length = srcLength;
360 int ucs2Length = Utf8ToUcs2(reinterpret_cast<uint8_t *>(pUcs2Text), maxUcs2Length * sizeof(WCHAR), src, srcLength);
364 tempTextLen = (srcLength > maxLength) ? maxLength : srcLength;
394 uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, const MsgLangInfo &langInfo)
396 int maxUcs2Length = srcLength;
411 TELEPHONY_LOGI("max dest Length = %{public}d, srcLength = %{public}d", maxLength, srcLength);
413 Gsm7bitToUcs2(reinterpret_cast<uint8_t *>(pUcs2Text), maxUcs2Length * sizeof(WCHAR), src, srcLength, langInfo);
429 int TextCoder::Ucs2ToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength)
431 if (srcLength == -1 && src) {
434 srcLength = strlen(reinterpret_cast<gchar *>(const_cast<uint8_t *>(src)));
436 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
441 gsize textLen = static_cast<gsize>(srcLength);
460 int TextCoder::EuckrToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength)
462 if (srcLength == -1 && src) {
464 srcLength = strlen(reinterpret_cast<gchar *>(const_cast<uint8_t *>(src)));
466 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
472 gsize textLen = static_cast<gsize>(srcLength);
491 int TextCoder::ShiftjisToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength) const
493 if (srcLength == -1 && src) {
495 srcLength = strlen(reinterpret_cast<gchar *>(const_cast<uint8_t *>(src)));
497 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
502 gsize textLen = static_cast<gsize>(srcLength);
520 int TextCoder::Ucs2ToGsm7bit(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, MSG_LANGUAGE_ID_T &langId)
522 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
529 uint8_t currType = GetLangType(src, srcLength);
531 for (int index = 0; index < (srcLength - 1); index += UCS2_LEN_MIN) {
596 int TextCoder::Ucs2ToGsm7bitAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength,
599 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
609 for (int i = 0; i < srcLength - 1; i += UCS2_LEN_MIN) {
638 int TextCoder::Ucs2ToAscii(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, bool &unknown)
640 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
649 for (int index = 0; index < srcLength - 1; index += UCS2_LEN_MIN) {
668 uint8_t TextCoder::GetLangType(const uint8_t *src, int srcLength)
670 if (srcLength <= 0 || src == nullptr) {
679 for (int index = 0; index < (srcLength - 1); index += UCS2_LEN_MIN) {
801 uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, const MsgLangInfo &langInfo)
803 if (srcLength == 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
812 for (int i = 0; i < srcLength && maxLength > UCS2_LEN_MIN; i++) {
820 i += EscapeTurkishLockingToUcs2(&src[i], (srcLength - i), langInfo, result);
824 i += EscapePortuLockingToUcs2(&src[i], (srcLength - i), langInfo, result);
829 i += EscapeGsm7bitToUcs2(&src[i], (srcLength - i), langInfo, result);