1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/corefoundation/cfstring.cpp
3 // Purpose: wxCFStringHolder and other string functions
4 // Author: Stefan Csomor
6 // Created: 2004-10-29 (from code in src/mac/carbon/utils.cpp)
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 // Usage: Darwin (base library)
11 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/wxprec.h"
16 #include "wx/string.h"
23 #include "wx/mac/corefoundation/cfstring.h"
26 #include <CoreServices/CoreServices.h>
28 #include <TextCommon.h>
31 void wxMacConvertNewlines13To10( char * data
)
34 while( (buf
=strchr(buf
,0x0d)) != NULL
)
41 void wxMacConvertNewlines10To13( char * data
)
44 while( (buf
=strchr(buf
,0x0a)) != NULL
)
51 const wxString
sCR((wxChar
)13);
52 const wxString
sLF((wxChar
)10);
54 void wxMacConvertNewlines13To10( wxString
* data
)
56 data
->Replace( sCR
,sLF
);
59 void wxMacConvertNewlines10To13( wxString
* data
)
61 data
->Replace( sLF
,sCR
);
64 wxUint32
wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding
)
66 TextEncodingBase enc
= 0 ;
67 if ( encoding
== wxFONTENCODING_DEFAULT
)
70 encoding
= wxFont::GetDefaultEncoding() ;
72 encoding
= wxFONTENCODING_SYSTEM
; // to be set below
76 if ( encoding
== wxFONTENCODING_SYSTEM
)
78 enc
= CFStringGetSystemEncoding();
83 case wxFONTENCODING_ISO8859_1
:
84 enc
= kTextEncodingISOLatin1
;
86 case wxFONTENCODING_ISO8859_2
:
87 enc
= kTextEncodingISOLatin2
;
89 case wxFONTENCODING_ISO8859_3
:
90 enc
= kTextEncodingISOLatin3
;
92 case wxFONTENCODING_ISO8859_4
:
93 enc
= kTextEncodingISOLatin4
;
95 case wxFONTENCODING_ISO8859_5
:
96 enc
= kTextEncodingISOLatinCyrillic
;
98 case wxFONTENCODING_ISO8859_6
:
99 enc
= kTextEncodingISOLatinArabic
;
101 case wxFONTENCODING_ISO8859_7
:
102 enc
= kTextEncodingISOLatinGreek
;
104 case wxFONTENCODING_ISO8859_8
:
105 enc
= kTextEncodingISOLatinHebrew
;
107 case wxFONTENCODING_ISO8859_9
:
108 enc
= kTextEncodingISOLatin5
;
110 case wxFONTENCODING_ISO8859_10
:
111 enc
= kTextEncodingISOLatin6
;
113 case wxFONTENCODING_ISO8859_13
:
114 enc
= kTextEncodingISOLatin7
;
116 case wxFONTENCODING_ISO8859_14
:
117 enc
= kTextEncodingISOLatin8
;
119 case wxFONTENCODING_ISO8859_15
:
120 enc
= kTextEncodingISOLatin9
;
123 case wxFONTENCODING_KOI8
:
124 enc
= kTextEncodingKOI8_R
;
126 case wxFONTENCODING_ALTERNATIVE
: // MS-DOS CP866
127 enc
= kTextEncodingDOSRussian
;
130 case wxFONTENCODING_BULGARIAN :
134 case wxFONTENCODING_CP437
:
135 enc
=kTextEncodingDOSLatinUS
;
137 case wxFONTENCODING_CP850
:
138 enc
= kTextEncodingDOSLatin1
;
140 case wxFONTENCODING_CP852
:
141 enc
= kTextEncodingDOSLatin2
;
143 case wxFONTENCODING_CP855
:
144 enc
= kTextEncodingDOSCyrillic
;
146 case wxFONTENCODING_CP866
:
147 enc
=kTextEncodingDOSRussian
;
149 case wxFONTENCODING_CP874
:
150 enc
= kTextEncodingDOSThai
;
152 case wxFONTENCODING_CP932
:
153 enc
= kTextEncodingDOSJapanese
;
155 case wxFONTENCODING_CP936
:
156 enc
= kTextEncodingDOSChineseSimplif
;
158 case wxFONTENCODING_CP949
:
159 enc
= kTextEncodingDOSKorean
;
161 case wxFONTENCODING_CP950
:
162 enc
= kTextEncodingDOSChineseTrad
;
165 case wxFONTENCODING_CP1250
:
166 enc
= kTextEncodingWindowsLatin2
;
168 case wxFONTENCODING_CP1251
:
169 enc
=kTextEncodingWindowsCyrillic
;
171 case wxFONTENCODING_CP1252
:
172 enc
=kTextEncodingWindowsLatin1
;
174 case wxFONTENCODING_CP1253
:
175 enc
= kTextEncodingWindowsGreek
;
177 case wxFONTENCODING_CP1254
:
178 enc
= kTextEncodingWindowsLatin5
;
180 case wxFONTENCODING_CP1255
:
181 enc
=kTextEncodingWindowsHebrew
;
183 case wxFONTENCODING_CP1256
:
184 enc
=kTextEncodingWindowsArabic
;
186 case wxFONTENCODING_CP1257
:
187 enc
= kTextEncodingWindowsBalticRim
;
190 case wxFONTENCODING_UTF7
:
191 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF7Format
) ;
193 case wxFONTENCODING_UTF8
:
194 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF8Format
) ;
196 case wxFONTENCODING_EUC_JP
:
197 enc
= kTextEncodingEUC_JP
;
199 case wxFONTENCODING_UTF16BE
:
200 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
202 case wxFONTENCODING_UTF16LE
:
203 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
205 case wxFONTENCODING_UTF32BE
:
206 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
208 case wxFONTENCODING_UTF32LE
:
209 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
212 case wxFONTENCODING_MACROMAN
:
213 enc
= kTextEncodingMacRoman
;
215 case wxFONTENCODING_MACJAPANESE
:
216 enc
= kTextEncodingMacJapanese
;
218 case wxFONTENCODING_MACCHINESETRAD
:
219 enc
= kTextEncodingMacChineseTrad
;
221 case wxFONTENCODING_MACKOREAN
:
222 enc
= kTextEncodingMacKorean
;
224 case wxFONTENCODING_MACARABIC
:
225 enc
= kTextEncodingMacArabic
;
227 case wxFONTENCODING_MACHEBREW
:
228 enc
= kTextEncodingMacHebrew
;
230 case wxFONTENCODING_MACGREEK
:
231 enc
= kTextEncodingMacGreek
;
233 case wxFONTENCODING_MACCYRILLIC
:
234 enc
= kTextEncodingMacCyrillic
;
236 case wxFONTENCODING_MACDEVANAGARI
:
237 enc
= kTextEncodingMacDevanagari
;
239 case wxFONTENCODING_MACGURMUKHI
:
240 enc
= kTextEncodingMacGurmukhi
;
242 case wxFONTENCODING_MACGUJARATI
:
243 enc
= kTextEncodingMacGujarati
;
245 case wxFONTENCODING_MACORIYA
:
246 enc
= kTextEncodingMacOriya
;
248 case wxFONTENCODING_MACBENGALI
:
249 enc
= kTextEncodingMacBengali
;
251 case wxFONTENCODING_MACTAMIL
:
252 enc
= kTextEncodingMacTamil
;
254 case wxFONTENCODING_MACTELUGU
:
255 enc
= kTextEncodingMacTelugu
;
257 case wxFONTENCODING_MACKANNADA
:
258 enc
= kTextEncodingMacKannada
;
260 case wxFONTENCODING_MACMALAJALAM
:
261 enc
= kTextEncodingMacMalayalam
;
263 case wxFONTENCODING_MACSINHALESE
:
264 enc
= kTextEncodingMacSinhalese
;
266 case wxFONTENCODING_MACBURMESE
:
267 enc
= kTextEncodingMacBurmese
;
269 case wxFONTENCODING_MACKHMER
:
270 enc
= kTextEncodingMacKhmer
;
272 case wxFONTENCODING_MACTHAI
:
273 enc
= kTextEncodingMacThai
;
275 case wxFONTENCODING_MACLAOTIAN
:
276 enc
= kTextEncodingMacLaotian
;
278 case wxFONTENCODING_MACGEORGIAN
:
279 enc
= kTextEncodingMacGeorgian
;
281 case wxFONTENCODING_MACARMENIAN
:
282 enc
= kTextEncodingMacArmenian
;
284 case wxFONTENCODING_MACCHINESESIMP
:
285 enc
= kTextEncodingMacChineseSimp
;
287 case wxFONTENCODING_MACTIBETAN
:
288 enc
= kTextEncodingMacTibetan
;
290 case wxFONTENCODING_MACMONGOLIAN
:
291 enc
= kTextEncodingMacMongolian
;
293 case wxFONTENCODING_MACETHIOPIC
:
294 enc
= kTextEncodingMacEthiopic
;
296 case wxFONTENCODING_MACCENTRALEUR
:
297 enc
= kTextEncodingMacCentralEurRoman
;
299 case wxFONTENCODING_MACVIATNAMESE
:
300 enc
= kTextEncodingMacVietnamese
;
302 case wxFONTENCODING_MACARABICEXT
:
303 enc
= kTextEncodingMacExtArabic
;
305 case wxFONTENCODING_MACSYMBOL
:
306 enc
= kTextEncodingMacSymbol
;
308 case wxFONTENCODING_MACDINGBATS
:
309 enc
= kTextEncodingMacDingbats
;
311 case wxFONTENCODING_MACTURKISH
:
312 enc
= kTextEncodingMacTurkish
;
314 case wxFONTENCODING_MACCROATIAN
:
315 enc
= kTextEncodingMacCroatian
;
317 case wxFONTENCODING_MACICELANDIC
:
318 enc
= kTextEncodingMacIcelandic
;
320 case wxFONTENCODING_MACROMANIAN
:
321 enc
= kTextEncodingMacRomanian
;
323 case wxFONTENCODING_MACCELTIC
:
324 enc
= kTextEncodingMacCeltic
;
326 case wxFONTENCODING_MACGAELIC
:
327 enc
= kTextEncodingMacGaelic
;
329 case wxFONTENCODING_MACKEYBOARD
:
330 enc
= kTextEncodingMacKeyboardGlyphs
;
332 default : // to make gcc happy
338 wxFontEncoding
wxMacGetFontEncFromSystemEnc(wxUint32 encoding
)
340 wxFontEncoding enc
= wxFONTENCODING_DEFAULT
;
344 case kTextEncodingISOLatin1
:
345 enc
= wxFONTENCODING_ISO8859_1
;
347 case kTextEncodingISOLatin2
:
348 enc
= wxFONTENCODING_ISO8859_2
;
350 case kTextEncodingISOLatin3
:
351 enc
= wxFONTENCODING_ISO8859_3
;
353 case kTextEncodingISOLatin4
:
354 enc
= wxFONTENCODING_ISO8859_4
;
356 case kTextEncodingISOLatinCyrillic
:
357 enc
= wxFONTENCODING_ISO8859_5
;
359 case kTextEncodingISOLatinArabic
:
360 enc
= wxFONTENCODING_ISO8859_6
;
362 case kTextEncodingISOLatinGreek
:
363 enc
= wxFONTENCODING_ISO8859_7
;
365 case kTextEncodingISOLatinHebrew
:
366 enc
= wxFONTENCODING_ISO8859_8
;
368 case kTextEncodingISOLatin5
:
369 enc
= wxFONTENCODING_ISO8859_9
;
371 case kTextEncodingISOLatin6
:
372 enc
= wxFONTENCODING_ISO8859_10
;
374 case kTextEncodingISOLatin7
:
375 enc
= wxFONTENCODING_ISO8859_13
;
377 case kTextEncodingISOLatin8
:
378 enc
= wxFONTENCODING_ISO8859_14
;
380 case kTextEncodingISOLatin9
:
381 enc
=wxFONTENCODING_ISO8859_15
;
384 case kTextEncodingKOI8_R
:
385 enc
= wxFONTENCODING_KOI8
;
389 enc = wxFONTENCODING_BULGARIAN;
392 case kTextEncodingDOSLatinUS
:
393 enc
= wxFONTENCODING_CP437
;
395 case kTextEncodingDOSLatin1
:
396 enc
= wxFONTENCODING_CP850
;
398 case kTextEncodingDOSLatin2
:
399 enc
=wxFONTENCODING_CP852
;
401 case kTextEncodingDOSCyrillic
:
402 enc
= wxFONTENCODING_CP855
;
404 case kTextEncodingDOSRussian
:
405 enc
= wxFONTENCODING_CP866
;
407 case kTextEncodingDOSThai
:
408 enc
=wxFONTENCODING_CP874
;
410 case kTextEncodingDOSJapanese
:
411 enc
= wxFONTENCODING_CP932
;
413 case kTextEncodingDOSChineseSimplif
:
414 enc
= wxFONTENCODING_CP936
;
416 case kTextEncodingDOSKorean
:
417 enc
= wxFONTENCODING_CP949
;
419 case kTextEncodingDOSChineseTrad
:
420 enc
= wxFONTENCODING_CP950
;
423 case kTextEncodingWindowsLatin2
:
424 enc
= wxFONTENCODING_CP1250
;
426 case kTextEncodingWindowsCyrillic
:
427 enc
= wxFONTENCODING_CP1251
;
429 case kTextEncodingWindowsLatin1
:
430 enc
= wxFONTENCODING_CP1252
;
432 case kTextEncodingWindowsGreek
:
433 enc
= wxFONTENCODING_CP1253
;
435 case kTextEncodingWindowsLatin5
:
436 enc
= wxFONTENCODING_CP1254
;
438 case kTextEncodingWindowsHebrew
:
439 enc
= wxFONTENCODING_CP1255
;
441 case kTextEncodingWindowsArabic
:
442 enc
= wxFONTENCODING_CP1256
;
444 case kTextEncodingWindowsBalticRim
:
445 enc
=wxFONTENCODING_CP1257
;
447 case kTextEncodingEUC_JP
:
448 enc
= wxFONTENCODING_EUC_JP
;
451 case wxFONTENCODING_UTF7
:
452 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF7Format
) ;
454 case wxFONTENCODING_UTF8
:
455 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF8Format
) ;
457 case wxFONTENCODING_UTF16BE
:
458 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
460 case wxFONTENCODING_UTF16LE
:
461 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
463 case wxFONTENCODING_UTF32BE
:
464 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
466 case wxFONTENCODING_UTF32LE
:
467 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
470 case kTextEncodingMacRoman
:
471 enc
= wxFONTENCODING_MACROMAN
;
473 case kTextEncodingMacJapanese
:
474 enc
= wxFONTENCODING_MACJAPANESE
;
476 case kTextEncodingMacChineseTrad
:
477 enc
= wxFONTENCODING_MACCHINESETRAD
;
479 case kTextEncodingMacKorean
:
480 enc
= wxFONTENCODING_MACKOREAN
;
482 case kTextEncodingMacArabic
:
483 enc
=wxFONTENCODING_MACARABIC
;
485 case kTextEncodingMacHebrew
:
486 enc
= wxFONTENCODING_MACHEBREW
;
488 case kTextEncodingMacGreek
:
489 enc
= wxFONTENCODING_MACGREEK
;
491 case kTextEncodingMacCyrillic
:
492 enc
= wxFONTENCODING_MACCYRILLIC
;
494 case kTextEncodingMacDevanagari
:
495 enc
= wxFONTENCODING_MACDEVANAGARI
;
497 case kTextEncodingMacGurmukhi
:
498 enc
= wxFONTENCODING_MACGURMUKHI
;
500 case kTextEncodingMacGujarati
:
501 enc
= wxFONTENCODING_MACGUJARATI
;
503 case kTextEncodingMacOriya
:
504 enc
=wxFONTENCODING_MACORIYA
;
506 case kTextEncodingMacBengali
:
507 enc
=wxFONTENCODING_MACBENGALI
;
509 case kTextEncodingMacTamil
:
510 enc
= wxFONTENCODING_MACTAMIL
;
512 case kTextEncodingMacTelugu
:
513 enc
= wxFONTENCODING_MACTELUGU
;
515 case kTextEncodingMacKannada
:
516 enc
= wxFONTENCODING_MACKANNADA
;
518 case kTextEncodingMacMalayalam
:
519 enc
= wxFONTENCODING_MACMALAJALAM
;
521 case kTextEncodingMacSinhalese
:
522 enc
= wxFONTENCODING_MACSINHALESE
;
524 case kTextEncodingMacBurmese
:
525 enc
= wxFONTENCODING_MACBURMESE
;
527 case kTextEncodingMacKhmer
:
528 enc
= wxFONTENCODING_MACKHMER
;
530 case kTextEncodingMacThai
:
531 enc
= wxFONTENCODING_MACTHAI
;
533 case kTextEncodingMacLaotian
:
534 enc
= wxFONTENCODING_MACLAOTIAN
;
536 case kTextEncodingMacGeorgian
:
537 enc
= wxFONTENCODING_MACGEORGIAN
;
539 case kTextEncodingMacArmenian
:
540 enc
= wxFONTENCODING_MACARMENIAN
;
542 case kTextEncodingMacChineseSimp
:
543 enc
= wxFONTENCODING_MACCHINESESIMP
;
545 case kTextEncodingMacTibetan
:
546 enc
= wxFONTENCODING_MACTIBETAN
;
548 case kTextEncodingMacMongolian
:
549 enc
= wxFONTENCODING_MACMONGOLIAN
;
551 case kTextEncodingMacEthiopic
:
552 enc
= wxFONTENCODING_MACETHIOPIC
;
554 case kTextEncodingMacCentralEurRoman
:
555 enc
= wxFONTENCODING_MACCENTRALEUR
;
557 case kTextEncodingMacVietnamese
:
558 enc
= wxFONTENCODING_MACVIATNAMESE
;
560 case kTextEncodingMacExtArabic
:
561 enc
= wxFONTENCODING_MACARABICEXT
;
563 case kTextEncodingMacSymbol
:
564 enc
= wxFONTENCODING_MACSYMBOL
;
566 case kTextEncodingMacDingbats
:
567 enc
= wxFONTENCODING_MACDINGBATS
;
569 case kTextEncodingMacTurkish
:
570 enc
= wxFONTENCODING_MACTURKISH
;
572 case kTextEncodingMacCroatian
:
573 enc
= wxFONTENCODING_MACCROATIAN
;
575 case kTextEncodingMacIcelandic
:
576 enc
= wxFONTENCODING_MACICELANDIC
;
578 case kTextEncodingMacRomanian
:
579 enc
= wxFONTENCODING_MACROMANIAN
;
581 case kTextEncodingMacCeltic
:
582 enc
= wxFONTENCODING_MACCELTIC
;
584 case kTextEncodingMacGaelic
:
585 enc
= wxFONTENCODING_MACGAELIC
;
587 case kTextEncodingMacKeyboardGlyphs
:
588 enc
= wxFONTENCODING_MACKEYBOARD
;
596 // CFStringRefs (Carbon only)
599 // converts this string into a carbon foundation string with optional pc 2 mac encoding
601 void wxMacCFStringHolder::Assign( CFStringRef ref
, bool release
)
608 void wxMacCFStringHolder::Assign( const wxString
&st
, wxFontEncoding
WXUNUSED_IN_UNICODE(encoding
) )
619 wxMacConvertNewlines13To10( &str
) ;
621 #if SIZEOF_WCHAR_T == 2
622 m_cfs
= CFStringCreateWithCharacters( kCFAllocatorDefault
,
623 (UniChar
*)str
.wc_str() , str
.Len() );
625 wxMBConvUTF16 converter
;
626 size_t unicharlen
= converter
.WC2MB( NULL
, str
.wc_str() , 0 ) ;
627 UniChar
*unibuf
= new UniChar
[ unicharlen
/ sizeof(UniChar
) + 1 ] ;
628 converter
.WC2MB( (char*)unibuf
, str
.wc_str() , unicharlen
) ;
629 m_cfs
= CFStringCreateWithCharacters( kCFAllocatorDefault
,
630 unibuf
, unicharlen
/ sizeof(UniChar
) ) ;
633 #else // not wxUSE_UNICODE
634 m_cfs
= CFStringCreateWithCString( kCFAllocatorSystemDefault
, str
.c_str() ,
635 wxMacGetSystemEncFromFontEnc( encoding
) ) ;
641 wxString
wxMacCFStringHolder::AsString(wxFontEncoding
WXUNUSED_IN_UNICODE(encoding
))
644 return wxEmptyString
;
646 Size cflen
= CFStringGetLength( m_cfs
) ;
651 #if SIZEOF_WCHAR_T == 2
652 buf
= new wxChar
[ cflen
+ 1 ] ;
653 CFStringGetCharacters( m_cfs
, CFRangeMake( 0 , cflen
) , (UniChar
*) buf
) ;
656 UniChar
* unibuf
= new UniChar
[ cflen
+ 1 ] ;
657 CFStringGetCharacters( m_cfs
, CFRangeMake( 0 , cflen
) , (UniChar
*) unibuf
) ;
659 wxMBConvUTF16 converter
;
660 noChars
= converter
.MB2WC( NULL
, (const char*)unibuf
, 0 ) ;
661 wxASSERT_MSG( noChars
!= wxCONV_FAILED
, _T("Unable to count the number of characters in this string!") );
662 buf
= new wxChar
[ noChars
+ 1 ] ;
663 noChars
= converter
.MB2WC( buf
, (const char*)unibuf
, noChars
+ 1 ) ;
664 wxASSERT_MSG( noChars
!= wxCONV_FAILED
, _T("Conversion of string failed!") );
669 CFStringGetBytes( m_cfs
, CFRangeMake(0, cflen
) , wxMacGetSystemEncFromFontEnc( encoding
) ,
670 '?' , false , NULL
, 0 , &cStrLen
) ;
671 buf
= new wxChar
[ cStrLen
+ 1 ] ;
672 CFStringGetBytes( m_cfs
, CFRangeMake(0, cflen
) , wxMacGetSystemEncFromFontEnc( encoding
) ,
673 '?' , false , (unsigned char*) buf
, cStrLen
, &cStrLen
) ;
678 wxString
result(buf
) ;
680 wxMacConvertNewlines10To13( &result
);
685 wxMacUniCharBuffer::wxMacUniCharBuffer( const wxString
&str
)
687 m_chars
= str
.length() ;
690 #if SIZEOF_WCHAR_T == 4
691 wxMBConvUTF16 converter
;
693 size_t unicharlen
= converter
.WC2MB( NULL
, str
.wc_str() , 0 ) ;
694 m_ubuf
= (UniChar
*) malloc( unicharlen
+ 2 ) ;
695 converter
.WC2MB( (char*) m_ubuf
, str
.wc_str(), unicharlen
+ 2 ) ;
697 const wxWCharBuffer wchar
= str
.wc_str( wxConvLocal
) ;
698 size_t unicharlen
= converter
.WC2MB( NULL
, wchar
.data() , 0 ) ;
699 m_ubuf
= (UniChar
*) malloc( unicharlen
+ 2 ) ;
700 converter
.WC2MB( (char*) m_ubuf
, wchar
.data() , unicharlen
+ 2 ) ;
702 m_chars
= unicharlen
/ 2 ;
703 #else // SIZEOF_WCHAR_T is then 2
705 m_ubuf
= malloc( m_chars
* 2 + 2 ) ;
706 memcpy( m_ubuf
, (UniChar
*) str
.wc_str() , m_chars
* 2 + 2 ) ;
708 wxWCharBuffer wchar
= str
.wc_str( wxConvLocal
) ;
709 m_chars
= wxWcslen( wchar
.data() ) ;
710 m_ubuf
= malloc( m_chars
* 2 + 2 ) ;
711 memcpy( m_ubuf
, (UniChar
*) wchar
.data() , m_chars
* 2 + 2 ) ;
716 wxMacUniCharBuffer::~wxMacUniCharBuffer()
721 UniCharArrayPtr
wxMacUniCharBuffer::GetBuffer()
726 UniCharCount
wxMacUniCharBuffer::GetChars()