1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <rtl/textcvt.h>
24 #include "handleundefinedunicodetotextchar.hxx"
25 #include "tenchelp.hxx"
26 #include "unichars.hxx"
28 /* DBCS to Unicode conversion routine use a lead table for the first byte, */
29 /* where we determine the trail table or for single byte chars the unicode */
30 /* value. We have for all lead byte a separate table, because we can */
31 /* then share many tables for different charset encodings. */
33 sal_Size
ImplDBCSToUnicode( const void* pData
, SAL_UNUSED_PARAMETER
void*,
34 const char* pSrcBuf
, sal_Size nSrcBytes
,
35 sal_Unicode
* pDestBuf
, sal_Size nDestChars
,
36 sal_uInt32 nFlags
, sal_uInt32
* pInfo
,
37 sal_Size
* pSrcCvtBytes
)
41 const ImplDBCSToUniLeadTab
* pLeadEntry
;
42 const ImplDBCSConvertData
* pConvertData
= static_cast<const ImplDBCSConvertData
*>(pData
);
43 const ImplDBCSToUniLeadTab
* pLeadTab
= pConvertData
->mpToUniLeadTab
;
44 sal_Unicode
* pEndDestBuf
;
45 const char* pEndSrcBuf
;
46 char const * startOfCurrentChar
= pSrcBuf
;
49 pEndDestBuf
= pDestBuf
+nDestChars
;
50 pEndSrcBuf
= pSrcBuf
+nSrcBytes
;
51 while ( pSrcBuf
< pEndSrcBuf
)
53 unsigned char cLead
= static_cast<unsigned char>(*pSrcBuf
);
55 /* get entry for the lead byte */
56 pLeadEntry
= pLeadTab
+cLead
;
58 /* SingleByte char? */
59 if (pLeadEntry
->mpToUniTrailTab
== nullptr
60 || cLead
< pConvertData
->mnLeadStart
61 || cLead
> pConvertData
->mnLeadEnd
)
63 cConv
= pLeadEntry
->mnUniChar
;
64 if ( !cConv
&& (cLead
!= 0) )
66 *pInfo
|= RTL_TEXTTOUNICODE_INFO_UNDEFINED
;
67 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MASK
) == RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
)
69 if ((nFlags
& RTL_TEXTTOUNICODE_FLAGS_FLUSH
) == 0) {
72 pSrcBuf
= startOfCurrentChar
;
74 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
;
77 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MASK
) == RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE
)
80 startOfCurrentChar
= pSrcBuf
;
83 cConv
= ImplGetUndefinedUnicodeChar(cLead
, nFlags
);
88 /* Source buffer too small */
89 if ( pSrcBuf
+1 == pEndSrcBuf
)
91 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_FLUSH
) == 0 )
93 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
| RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL
;
101 cTrail
= static_cast<unsigned char>(*pSrcBuf
);
102 if ( (cTrail
>= pLeadEntry
->mnTrailStart
) && (cTrail
<= pLeadEntry
->mnTrailEnd
) )
103 cConv
= pLeadEntry
->mpToUniTrailTab
[cTrail
-pLeadEntry
->mnTrailStart
];
111 const ImplDBCSEUDCData
* pEUDCTab
= pConvertData
->mpEUDCTab
;
112 for ( i
= 0; i
< pConvertData
->mnEUDCCount
; i
++ )
114 if ( (cLead
>= pEUDCTab
->mnLeadStart
) &&
115 (cLead
<= pEUDCTab
->mnLeadEnd
) )
117 if ( (cTrail
>= pEUDCTab
->mnTrail1Start
) &&
118 (cTrail
<= pEUDCTab
->mnTrail1End
) )
120 cConv
= pEUDCTab
->mnUniStart
+
121 ((cLead
-pEUDCTab
->mnLeadStart
)*pEUDCTab
->mnTrailRangeCount
)+
122 (cTrail
-pEUDCTab
->mnTrail1Start
);
125 sal_uInt16 nTrailCount
= pEUDCTab
->mnTrail1End
-pEUDCTab
->mnTrail1Start
+1;
126 if ( (pEUDCTab
->mnTrailCount
>= 2) &&
127 (cTrail
>= pEUDCTab
->mnTrail2Start
) &&
128 (cTrail
<= pEUDCTab
->mnTrail2End
) )
130 cConv
= pEUDCTab
->mnUniStart
+
131 ((cLead
-pEUDCTab
->mnLeadStart
)*pEUDCTab
->mnTrailRangeCount
)+
133 (cTrail
-pEUDCTab
->mnTrail2Start
);
136 nTrailCount
= pEUDCTab
->mnTrail2End
-pEUDCTab
->mnTrail2Start
+1;
137 if ( (pEUDCTab
->mnTrailCount
>= 3) &&
138 (cTrail
>= pEUDCTab
->mnTrail3Start
) &&
139 (cTrail
<= pEUDCTab
->mnTrail3End
) )
141 cConv
= pEUDCTab
->mnUniStart
+
142 ((cLead
-pEUDCTab
->mnLeadStart
)*pEUDCTab
->mnTrailRangeCount
)+
144 (cTrail
-pEUDCTab
->mnTrail3Start
);
154 /* We compare the full range of the trail we defined, */
155 /* which can often be greater than the limit. We do this */
156 /* so that extensions that don't consider encodings */
157 /* correctly treat double-byte characters as a single */
158 /* character as much as possible. */
160 if (cLead
< pConvertData
->mnLeadStart
161 || cLead
> pConvertData
->mnLeadEnd
162 || cTrail
< pConvertData
->mnTrailStart
163 || cTrail
> pConvertData
->mnTrailEnd
)
165 *pInfo
|= RTL_TEXTTOUNICODE_INFO_INVALID
;
166 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK
) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
)
168 if ((nFlags
& RTL_TEXTTOUNICODE_FLAGS_FLUSH
) == 0) {
171 pSrcBuf
= startOfCurrentChar
;
173 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
;
176 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK
) == RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE
)
179 startOfCurrentChar
= pSrcBuf
;
182 cConv
= RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER
;
189 *pInfo
|= RTL_TEXTTOUNICODE_INFO_MBUNDEFINED
;
190 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK
) == RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
)
192 if ((nFlags
& RTL_TEXTTOUNICODE_FLAGS_FLUSH
) == 0) {
195 pSrcBuf
= startOfCurrentChar
;
197 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
;
200 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK
) == RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_IGNORE
)
203 startOfCurrentChar
= pSrcBuf
;
206 cConv
= RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER
;
210 if ( pDestBuf
== pEndDestBuf
)
212 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
| RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOOSMALL
;
219 startOfCurrentChar
= pSrcBuf
;
222 *pSrcCvtBytes
= nSrcBytes
- (pEndSrcBuf
-pSrcBuf
);
223 return (nDestChars
- (pEndDestBuf
-pDestBuf
));
226 sal_Size
ImplUnicodeToDBCS( const void* pData
, SAL_UNUSED_PARAMETER
void*,
227 const sal_Unicode
* pSrcBuf
, sal_Size nSrcChars
,
228 char* pDestBuf
, sal_Size nDestBytes
,
229 sal_uInt32 nFlags
, sal_uInt32
* pInfo
,
230 sal_Size
* pSrcCvtChars
)
234 const ImplUniToDBCSHighTab
* pHighEntry
;
235 const ImplDBCSConvertData
* pConvertData
= static_cast<const ImplDBCSConvertData
*>(pData
);
236 const ImplUniToDBCSHighTab
* pHighTab
= pConvertData
->mpToDBCSHighTab
;
238 const sal_Unicode
* pEndSrcBuf
;
241 pConvertData
->mnLeadStart
!= 0 || pConvertData
->mnLeadEnd
!= 0xFF;
242 /* this statement has the effect that this extra check is only done for
243 EUC-KR, which uses the MS-949 tables, but does not support the full
247 pEndDestBuf
= pDestBuf
+nDestBytes
;
248 pEndSrcBuf
= pSrcBuf
+nSrcChars
;
249 while ( pSrcBuf
< pEndSrcBuf
)
252 unsigned char nHighChar
= static_cast<unsigned char>((c
>> 8) & 0xFF);
253 unsigned char nLowChar
= static_cast<unsigned char>(c
& 0xFF);
255 /* get entry for the high byte */
256 pHighEntry
= pHighTab
+nHighChar
;
258 /* is low byte in the table range */
259 if ( (nLowChar
>= pHighEntry
->mnLowStart
) && (nLowChar
<= pHighEntry
->mnLowEnd
) )
261 cConv
= pHighEntry
->mpToUniTrailTab
[nLowChar
-pHighEntry
->mnLowStart
];
262 if (bCheckRange
&& cConv
> 0x7F
263 && ((cConv
>> 8) < pConvertData
->mnLeadStart
264 || (cConv
>> 8) > pConvertData
->mnLeadEnd
265 || (cConv
& 0xFF) < pConvertData
->mnTrailStart
266 || (cConv
& 0xFF) > pConvertData
->mnTrailEnd
))
272 if (cConv
== 0 && c
!= 0)
274 /* Map to EUDC ranges: */
275 ImplDBCSEUDCData
const * pEUDCTab
= pConvertData
->mpEUDCTab
;
277 for (i
= 0; i
< pConvertData
->mnEUDCCount
; ++i
)
279 if (c
>= pEUDCTab
->mnUniStart
&& c
<= pEUDCTab
->mnUniEnd
)
281 sal_uInt32 nIndex
= c
- pEUDCTab
->mnUniStart
;
283 = nIndex
/ pEUDCTab
->mnTrailRangeCount
;
285 = nIndex
% pEUDCTab
->mnTrailRangeCount
;
287 cConv
= static_cast<sal_uInt16
>((pEUDCTab
->mnLeadStart
+ nLeadOff
) << 8);
289 = pEUDCTab
->mnTrail1End
- pEUDCTab
->mnTrail1Start
+ 1;
290 if (nTrailOff
< nSize
)
292 cConv
|= pEUDCTab
->mnTrail1Start
+ nTrailOff
;
297 = pEUDCTab
->mnTrail2End
- pEUDCTab
->mnTrail2Start
+ 1;
298 if (nTrailOff
< nSize
)
300 cConv
|= pEUDCTab
->mnTrail2Start
+ nTrailOff
;
304 cConv
|= pEUDCTab
->mnTrail3Start
+ nTrailOff
;
311 * SB: Not sure why this is in here. Plus, it does not work as
312 * intended when (c & 0xFF) == 0, because the next !cConv check
313 * will then think c has not yet been converted...
315 if (c
>= RTL_TEXTCVT_BYTE_PRIVATE_START
316 && c
<= RTL_TEXTCVT_BYTE_PRIVATE_END
)
318 if ( nFlags
& RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0
)
319 cConv
= static_cast< char >(static_cast< unsigned char >(c
& 0xFF));
323 if (cConv
== 0 && c
!= 0)
325 if ( nFlags
& RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE
)
330 if ( nFlags
& RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACESTR
)
335 /* Handle undefined and surrogates characters */
336 /* (all surrogates characters are undefined) */
337 if (sal::detail::textenc::handleUndefinedUnicodeToTextChar(
338 &pSrcBuf
, pEndSrcBuf
, &pDestBuf
, pEndDestBuf
, nFlags
,
345 if ( !(cConv
& 0xFF00) )
347 if ( pDestBuf
== pEndDestBuf
)
349 *pInfo
|= RTL_UNICODETOTEXT_INFO_ERROR
| RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL
;
353 *pDestBuf
= static_cast< char >(static_cast< unsigned char >(cConv
& 0xFF));
358 if ( pDestBuf
+1 >= pEndDestBuf
)
360 *pInfo
|= RTL_UNICODETOTEXT_INFO_ERROR
| RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL
;
364 *pDestBuf
= static_cast< char >(static_cast< unsigned char >((cConv
>> 8) & 0xFF));
366 *pDestBuf
= static_cast< char >(static_cast< unsigned char >(cConv
& 0xFF));
373 *pSrcCvtChars
= nSrcChars
- (pEndSrcBuf
-pSrcBuf
);
374 return (nDestBytes
- (pEndDestBuf
-pDestBuf
));
377 #define JIS_EUC_LEAD_OFF 0x80
378 #define JIS_EUC_TRAIL_OFF 0x80
380 sal_Size
ImplEUCJPToUnicode( const void* pData
,
381 SAL_UNUSED_PARAMETER
void*,
382 const char* pSrcBuf
, sal_Size nSrcBytes
,
383 sal_Unicode
* pDestBuf
, sal_Size nDestChars
,
384 sal_uInt32 nFlags
, sal_uInt32
* pInfo
,
385 sal_Size
* pSrcCvtBytes
)
387 unsigned char cLead
= '\0';
388 unsigned char cTrail
= '\0';
390 const ImplDBCSToUniLeadTab
* pLeadEntry
;
391 const ImplDBCSToUniLeadTab
* pLeadTab
;
392 const ImplEUCJPConvertData
* pConvertData
= static_cast<const ImplEUCJPConvertData
*>(pData
);
393 sal_Unicode
* pEndDestBuf
;
394 const char* pEndSrcBuf
;
395 char const * startOfCurrentChar
= pSrcBuf
;
398 pEndDestBuf
= pDestBuf
+nDestChars
;
399 pEndSrcBuf
= pSrcBuf
+nSrcBytes
;
400 while ( pSrcBuf
< pEndSrcBuf
)
402 unsigned char c
= static_cast<unsigned char>(*pSrcBuf
);
409 /* SS2 - Half-width katakana */
413 /* Source buffer too small */
414 if ( pSrcBuf
+ 1 == pEndSrcBuf
)
416 *pInfo
|= RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL
;
421 c
= static_cast<unsigned char>(*pSrcBuf
);
422 if ( (c
>= 0xA1) && (c
<= 0xDF) )
423 cConv
= 0xFF61+(c
-0xA1);
433 /* SS3 - JIS 0212-1990 */
434 /* 8F + A1-FE + A1-FE */
437 /* Source buffer too small */
438 if (pEndSrcBuf
- pSrcBuf
< 3)
440 *pInfo
|= RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL
;
445 cLead
= static_cast<unsigned char>(*pSrcBuf
);
447 cTrail
= static_cast<unsigned char>(*pSrcBuf
);
448 pLeadTab
= pConvertData
->mpJIS0212ToUniLeadTab
;
450 /* CodeSet 2 JIS 0208-1997 */
454 /* Source buffer too small */
455 if ( pSrcBuf
+ 1 == pEndSrcBuf
)
457 *pInfo
|= RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOOSMALL
;
463 cTrail
= static_cast<unsigned char>(*pSrcBuf
);
464 pLeadTab
= pConvertData
->mpJIS0208ToUniLeadTab
;
467 /* Undefined Range */
468 if ( (cLead
< JIS_EUC_LEAD_OFF
) || (cTrail
< JIS_EUC_TRAIL_OFF
) )
472 cLead
-= JIS_EUC_LEAD_OFF
;
473 cTrail
-= JIS_EUC_TRAIL_OFF
;
474 pLeadEntry
= pLeadTab
+cLead
;
475 if ( (cTrail
>= pLeadEntry
->mnTrailStart
) && (cTrail
<= pLeadEntry
->mnTrailEnd
) )
476 cConv
= pLeadEntry
->mpToUniTrailTab
[cTrail
-pLeadEntry
->mnTrailStart
];
484 /* We compare the full range of the trail we defined, */
485 /* which can often be greater than the limit. We do this */
486 /* so that extensions that don't consider encodings */
487 /* correctly treat double-byte characters as a single */
488 /* character as much as possible. */
490 if ( (cLead
< JIS_EUC_LEAD_OFF
) || (cTrail
< JIS_EUC_TRAIL_OFF
) )
492 *pInfo
|= RTL_TEXTTOUNICODE_INFO_INVALID
;
493 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK
) == RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
)
495 if ((nFlags
& RTL_TEXTTOUNICODE_FLAGS_FLUSH
) == 0) {
498 pSrcBuf
= startOfCurrentChar
;
500 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
;
503 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK
) == RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE
)
506 startOfCurrentChar
= pSrcBuf
;
509 cConv
= RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER
;
513 if ((nFlags
& RTL_TEXTTOUNICODE_FLAGS_FLUSH
) == 0) {
516 pSrcBuf
= startOfCurrentChar
;
518 *pInfo
|= RTL_TEXTTOUNICODE_INFO_MBUNDEFINED
;
519 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK
) == RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
)
521 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
;
524 if ( (nFlags
& RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK
) == RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_IGNORE
)
527 startOfCurrentChar
= pSrcBuf
;
530 cConv
= RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER
;
535 if ( pDestBuf
== pEndDestBuf
)
537 *pInfo
|= RTL_TEXTTOUNICODE_INFO_ERROR
| RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOOSMALL
;
544 startOfCurrentChar
= pSrcBuf
;
547 *pSrcCvtBytes
= nSrcBytes
- (pEndSrcBuf
-pSrcBuf
);
548 return (nDestChars
- (pEndDestBuf
-pDestBuf
));
551 sal_Size
ImplUnicodeToEUCJP( const void* pData
,
552 SAL_UNUSED_PARAMETER
void*,
553 const sal_Unicode
* pSrcBuf
, sal_Size nSrcChars
,
554 char* pDestBuf
, sal_Size nDestBytes
,
555 sal_uInt32 nFlags
, sal_uInt32
* pInfo
,
556 sal_Size
* pSrcCvtChars
)
560 unsigned char nHighChar
;
561 unsigned char nLowChar
;
562 const ImplUniToDBCSHighTab
* pHighEntry
;
563 const ImplUniToDBCSHighTab
* pHighTab
;
564 const ImplEUCJPConvertData
* pConvertData
= static_cast<const ImplEUCJPConvertData
*>(pData
);
566 const sal_Unicode
* pEndSrcBuf
;
569 pEndDestBuf
= pDestBuf
+nDestBytes
;
570 pEndSrcBuf
= pSrcBuf
+nSrcChars
;
571 while ( pSrcBuf
< pEndSrcBuf
)
578 /* Half-width katakana */
579 else if ( (c
>= 0xFF61) && (c
<= 0xFF9F) )
580 cConv
= 0x8E00+0xA1+(c
-0xFF61);
583 nHighChar
= static_cast<unsigned char>((c
>> 8) & 0xFF);
584 nLowChar
= static_cast<unsigned char>(c
& 0xFF);
587 pHighTab
= pConvertData
->mpUniToJIS0208HighTab
;
588 pHighEntry
= pHighTab
+nHighChar
;
589 if ( (nLowChar
>= pHighEntry
->mnLowStart
) && (nLowChar
<= pHighEntry
->mnLowEnd
) )
591 cConv
= pHighEntry
->mpToUniTrailTab
[nLowChar
-pHighEntry
->mnLowStart
];
601 pHighTab
= pConvertData
->mpUniToJIS0212HighTab
;
602 pHighEntry
= pHighTab
+nHighChar
;
603 if ( (nLowChar
>= pHighEntry
->mnLowStart
) && (nLowChar
<= pHighEntry
->mnLowEnd
) )
605 cConv
= pHighEntry
->mpToUniTrailTab
[nLowChar
-pHighEntry
->mnLowStart
];
612 if ( nFlags
& RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE
)
617 if ( nFlags
& RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACESTR
)
622 /* Handle undefined and surrogates characters */
623 /* (all surrogates characters are undefined) */
624 if (sal::detail::textenc::handleUndefinedUnicodeToTextChar(
625 &pSrcBuf
, pEndSrcBuf
, &pDestBuf
, pEndDestBuf
,
634 if ( !(cConv
& 0xFFFF00) )
636 if ( pDestBuf
== pEndDestBuf
)
638 *pInfo
|= RTL_UNICODETOTEXT_INFO_ERROR
| RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL
;
642 *pDestBuf
= static_cast< char >(static_cast< unsigned char >(cConv
& 0xFF));
646 else if ( !(cConv
& 0xFF0000) )
648 if ( pDestBuf
+1 >= pEndDestBuf
)
650 *pInfo
|= RTL_UNICODETOTEXT_INFO_ERROR
| RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL
;
654 *pDestBuf
= static_cast< char >(static_cast< unsigned char >((cConv
>> 8) & 0xFF));
656 *pDestBuf
= static_cast< char >(static_cast< unsigned char >(cConv
& 0xFF));
661 if ( pDestBuf
+2 >= pEndDestBuf
)
663 *pInfo
|= RTL_UNICODETOTEXT_INFO_ERROR
| RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL
;
667 *pDestBuf
= static_cast< char >(static_cast< unsigned char >((cConv
>> 16) & 0xFF));
669 *pDestBuf
= static_cast< char >(static_cast< unsigned char >((cConv
>> 8) & 0xFF));
671 *pDestBuf
= static_cast< char >(static_cast< unsigned char >(cConv
& 0xFF));
678 *pSrcCvtChars
= nSrcChars
- (pEndSrcBuf
-pSrcBuf
);
679 return (nDestBytes
- (pEndDestBuf
-pDestBuf
));
682 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */