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 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
15 #include "wx/string.h"
22 #include "wx/mac/corefoundation/cfstring.h"
25 #include <CoreServices/CoreServices.h>
27 #include <TextCommon.h>
30 void wxMacConvertNewlines13To10( char * data
)
33 while( (buf
=strchr(buf
,0x0d)) != NULL
)
40 void wxMacConvertNewlines10To13( char * data
)
43 while( (buf
=strchr(buf
,0x0a)) != NULL
)
50 const wxString
sCR((wxChar
)13);
51 const wxString
sLF((wxChar
)10);
53 void wxMacConvertNewlines13To10( wxString
* data
)
55 data
->Replace( sCR
,sLF
);
58 void wxMacConvertNewlines10To13( wxString
* data
)
60 data
->Replace( sLF
,sCR
);
63 wxUint32
wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding
)
65 TextEncodingBase enc
= 0 ;
66 if ( encoding
== wxFONTENCODING_DEFAULT
)
69 encoding
= wxFont::GetDefaultEncoding() ;
71 encoding
= wxFONTENCODING_SYSTEM
; // to be set below
75 if ( encoding
== wxFONTENCODING_SYSTEM
)
77 enc
= CFStringGetSystemEncoding();
82 case wxFONTENCODING_ISO8859_1
:
83 enc
= kTextEncodingISOLatin1
;
85 case wxFONTENCODING_ISO8859_2
:
86 enc
= kTextEncodingISOLatin2
;
88 case wxFONTENCODING_ISO8859_3
:
89 enc
= kTextEncodingISOLatin3
;
91 case wxFONTENCODING_ISO8859_4
:
92 enc
= kTextEncodingISOLatin4
;
94 case wxFONTENCODING_ISO8859_5
:
95 enc
= kTextEncodingISOLatinCyrillic
;
97 case wxFONTENCODING_ISO8859_6
:
98 enc
= kTextEncodingISOLatinArabic
;
100 case wxFONTENCODING_ISO8859_7
:
101 enc
= kTextEncodingISOLatinGreek
;
103 case wxFONTENCODING_ISO8859_8
:
104 enc
= kTextEncodingISOLatinHebrew
;
106 case wxFONTENCODING_ISO8859_9
:
107 enc
= kTextEncodingISOLatin5
;
109 case wxFONTENCODING_ISO8859_10
:
110 enc
= kTextEncodingISOLatin6
;
112 case wxFONTENCODING_ISO8859_13
:
113 enc
= kTextEncodingISOLatin7
;
115 case wxFONTENCODING_ISO8859_14
:
116 enc
= kTextEncodingISOLatin8
;
118 case wxFONTENCODING_ISO8859_15
:
119 enc
= kTextEncodingISOLatin9
;
122 case wxFONTENCODING_KOI8
:
123 enc
= kTextEncodingKOI8_R
;
125 case wxFONTENCODING_ALTERNATIVE
: // MS-DOS CP866
126 enc
= kTextEncodingDOSRussian
;
129 case wxFONTENCODING_BULGARIAN :
133 case wxFONTENCODING_CP437
:
134 enc
=kTextEncodingDOSLatinUS
;
136 case wxFONTENCODING_CP850
:
137 enc
= kTextEncodingDOSLatin1
;
139 case wxFONTENCODING_CP852
:
140 enc
= kTextEncodingDOSLatin2
;
142 case wxFONTENCODING_CP855
:
143 enc
= kTextEncodingDOSCyrillic
;
145 case wxFONTENCODING_CP866
:
146 enc
=kTextEncodingDOSRussian
;
148 case wxFONTENCODING_CP874
:
149 enc
= kTextEncodingDOSThai
;
151 case wxFONTENCODING_CP932
:
152 enc
= kTextEncodingDOSJapanese
;
154 case wxFONTENCODING_CP936
:
155 enc
= kTextEncodingDOSChineseSimplif
;
157 case wxFONTENCODING_CP949
:
158 enc
= kTextEncodingDOSKorean
;
160 case wxFONTENCODING_CP950
:
161 enc
= kTextEncodingDOSChineseTrad
;
164 case wxFONTENCODING_CP1250
:
165 enc
= kTextEncodingWindowsLatin2
;
167 case wxFONTENCODING_CP1251
:
168 enc
=kTextEncodingWindowsCyrillic
;
170 case wxFONTENCODING_CP1252
:
171 enc
=kTextEncodingWindowsLatin1
;
173 case wxFONTENCODING_CP1253
:
174 enc
= kTextEncodingWindowsGreek
;
176 case wxFONTENCODING_CP1254
:
177 enc
= kTextEncodingWindowsLatin5
;
179 case wxFONTENCODING_CP1255
:
180 enc
=kTextEncodingWindowsHebrew
;
182 case wxFONTENCODING_CP1256
:
183 enc
=kTextEncodingWindowsArabic
;
185 case wxFONTENCODING_CP1257
:
186 enc
= kTextEncodingWindowsBalticRim
;
189 case wxFONTENCODING_UTF7
:
190 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF7Format
) ;
192 case wxFONTENCODING_UTF8
:
193 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF8Format
) ;
195 case wxFONTENCODING_EUC_JP
:
196 enc
= kTextEncodingEUC_JP
;
198 case wxFONTENCODING_UTF16BE
:
199 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
201 case wxFONTENCODING_UTF16LE
:
202 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
204 case wxFONTENCODING_UTF32BE
:
205 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
207 case wxFONTENCODING_UTF32LE
:
208 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
211 case wxFONTENCODING_MACROMAN
:
212 enc
= kTextEncodingMacRoman
;
214 case wxFONTENCODING_MACJAPANESE
:
215 enc
= kTextEncodingMacJapanese
;
217 case wxFONTENCODING_MACCHINESETRAD
:
218 enc
= kTextEncodingMacChineseTrad
;
220 case wxFONTENCODING_MACKOREAN
:
221 enc
= kTextEncodingMacKorean
;
223 case wxFONTENCODING_MACARABIC
:
224 enc
= kTextEncodingMacArabic
;
226 case wxFONTENCODING_MACHEBREW
:
227 enc
= kTextEncodingMacHebrew
;
229 case wxFONTENCODING_MACGREEK
:
230 enc
= kTextEncodingMacGreek
;
232 case wxFONTENCODING_MACCYRILLIC
:
233 enc
= kTextEncodingMacCyrillic
;
235 case wxFONTENCODING_MACDEVANAGARI
:
236 enc
= kTextEncodingMacDevanagari
;
238 case wxFONTENCODING_MACGURMUKHI
:
239 enc
= kTextEncodingMacGurmukhi
;
241 case wxFONTENCODING_MACGUJARATI
:
242 enc
= kTextEncodingMacGujarati
;
244 case wxFONTENCODING_MACORIYA
:
245 enc
= kTextEncodingMacOriya
;
247 case wxFONTENCODING_MACBENGALI
:
248 enc
= kTextEncodingMacBengali
;
250 case wxFONTENCODING_MACTAMIL
:
251 enc
= kTextEncodingMacTamil
;
253 case wxFONTENCODING_MACTELUGU
:
254 enc
= kTextEncodingMacTelugu
;
256 case wxFONTENCODING_MACKANNADA
:
257 enc
= kTextEncodingMacKannada
;
259 case wxFONTENCODING_MACMALAJALAM
:
260 enc
= kTextEncodingMacMalayalam
;
262 case wxFONTENCODING_MACSINHALESE
:
263 enc
= kTextEncodingMacSinhalese
;
265 case wxFONTENCODING_MACBURMESE
:
266 enc
= kTextEncodingMacBurmese
;
268 case wxFONTENCODING_MACKHMER
:
269 enc
= kTextEncodingMacKhmer
;
271 case wxFONTENCODING_MACTHAI
:
272 enc
= kTextEncodingMacThai
;
274 case wxFONTENCODING_MACLAOTIAN
:
275 enc
= kTextEncodingMacLaotian
;
277 case wxFONTENCODING_MACGEORGIAN
:
278 enc
= kTextEncodingMacGeorgian
;
280 case wxFONTENCODING_MACARMENIAN
:
281 enc
= kTextEncodingMacArmenian
;
283 case wxFONTENCODING_MACCHINESESIMP
:
284 enc
= kTextEncodingMacChineseSimp
;
286 case wxFONTENCODING_MACTIBETAN
:
287 enc
= kTextEncodingMacTibetan
;
289 case wxFONTENCODING_MACMONGOLIAN
:
290 enc
= kTextEncodingMacMongolian
;
292 case wxFONTENCODING_MACETHIOPIC
:
293 enc
= kTextEncodingMacEthiopic
;
295 case wxFONTENCODING_MACCENTRALEUR
:
296 enc
= kTextEncodingMacCentralEurRoman
;
298 case wxFONTENCODING_MACVIATNAMESE
:
299 enc
= kTextEncodingMacVietnamese
;
301 case wxFONTENCODING_MACARABICEXT
:
302 enc
= kTextEncodingMacExtArabic
;
304 case wxFONTENCODING_MACSYMBOL
:
305 enc
= kTextEncodingMacSymbol
;
307 case wxFONTENCODING_MACDINGBATS
:
308 enc
= kTextEncodingMacDingbats
;
310 case wxFONTENCODING_MACTURKISH
:
311 enc
= kTextEncodingMacTurkish
;
313 case wxFONTENCODING_MACCROATIAN
:
314 enc
= kTextEncodingMacCroatian
;
316 case wxFONTENCODING_MACICELANDIC
:
317 enc
= kTextEncodingMacIcelandic
;
319 case wxFONTENCODING_MACROMANIAN
:
320 enc
= kTextEncodingMacRomanian
;
322 case wxFONTENCODING_MACCELTIC
:
323 enc
= kTextEncodingMacCeltic
;
325 case wxFONTENCODING_MACGAELIC
:
326 enc
= kTextEncodingMacGaelic
;
328 case wxFONTENCODING_MACKEYBOARD
:
329 enc
= kTextEncodingMacKeyboardGlyphs
;
331 default : // to make gcc happy
337 wxFontEncoding
wxMacGetFontEncFromSystemEnc(wxUint32 encoding
)
339 wxFontEncoding enc
= wxFONTENCODING_DEFAULT
;
343 case kTextEncodingISOLatin1
:
344 enc
= wxFONTENCODING_ISO8859_1
;
346 case kTextEncodingISOLatin2
:
347 enc
= wxFONTENCODING_ISO8859_2
;
349 case kTextEncodingISOLatin3
:
350 enc
= wxFONTENCODING_ISO8859_3
;
352 case kTextEncodingISOLatin4
:
353 enc
= wxFONTENCODING_ISO8859_4
;
355 case kTextEncodingISOLatinCyrillic
:
356 enc
= wxFONTENCODING_ISO8859_5
;
358 case kTextEncodingISOLatinArabic
:
359 enc
= wxFONTENCODING_ISO8859_6
;
361 case kTextEncodingISOLatinGreek
:
362 enc
= wxFONTENCODING_ISO8859_7
;
364 case kTextEncodingISOLatinHebrew
:
365 enc
= wxFONTENCODING_ISO8859_8
;
367 case kTextEncodingISOLatin5
:
368 enc
= wxFONTENCODING_ISO8859_9
;
370 case kTextEncodingISOLatin6
:
371 enc
= wxFONTENCODING_ISO8859_10
;
373 case kTextEncodingISOLatin7
:
374 enc
= wxFONTENCODING_ISO8859_13
;
376 case kTextEncodingISOLatin8
:
377 enc
= wxFONTENCODING_ISO8859_14
;
379 case kTextEncodingISOLatin9
:
380 enc
=wxFONTENCODING_ISO8859_15
;
383 case kTextEncodingKOI8_R
:
384 enc
= wxFONTENCODING_KOI8
;
388 enc = wxFONTENCODING_BULGARIAN;
391 case kTextEncodingDOSLatinUS
:
392 enc
= wxFONTENCODING_CP437
;
394 case kTextEncodingDOSLatin1
:
395 enc
= wxFONTENCODING_CP850
;
397 case kTextEncodingDOSLatin2
:
398 enc
=wxFONTENCODING_CP852
;
400 case kTextEncodingDOSCyrillic
:
401 enc
= wxFONTENCODING_CP855
;
403 case kTextEncodingDOSRussian
:
404 enc
= wxFONTENCODING_CP866
;
406 case kTextEncodingDOSThai
:
407 enc
=wxFONTENCODING_CP874
;
409 case kTextEncodingDOSJapanese
:
410 enc
= wxFONTENCODING_CP932
;
412 case kTextEncodingDOSChineseSimplif
:
413 enc
= wxFONTENCODING_CP936
;
415 case kTextEncodingDOSKorean
:
416 enc
= wxFONTENCODING_CP949
;
418 case kTextEncodingDOSChineseTrad
:
419 enc
= wxFONTENCODING_CP950
;
422 case kTextEncodingWindowsLatin2
:
423 enc
= wxFONTENCODING_CP1250
;
425 case kTextEncodingWindowsCyrillic
:
426 enc
= wxFONTENCODING_CP1251
;
428 case kTextEncodingWindowsLatin1
:
429 enc
= wxFONTENCODING_CP1252
;
431 case kTextEncodingWindowsGreek
:
432 enc
= wxFONTENCODING_CP1253
;
434 case kTextEncodingWindowsLatin5
:
435 enc
= wxFONTENCODING_CP1254
;
437 case kTextEncodingWindowsHebrew
:
438 enc
= wxFONTENCODING_CP1255
;
440 case kTextEncodingWindowsArabic
:
441 enc
= wxFONTENCODING_CP1256
;
443 case kTextEncodingWindowsBalticRim
:
444 enc
=wxFONTENCODING_CP1257
;
446 case kTextEncodingEUC_JP
:
447 enc
= wxFONTENCODING_EUC_JP
;
450 case wxFONTENCODING_UTF7
:
451 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF7Format
) ;
453 case wxFONTENCODING_UTF8
:
454 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicodeUTF8Format
) ;
456 case wxFONTENCODING_UTF16BE
:
457 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
459 case wxFONTENCODING_UTF16LE
:
460 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode16BitFormat
) ;
462 case wxFONTENCODING_UTF32BE
:
463 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
465 case wxFONTENCODING_UTF32LE
:
466 enc
= CreateTextEncoding(kTextEncodingUnicodeDefault
,0,kUnicode32BitFormat
) ;
469 case kTextEncodingMacRoman
:
470 enc
= wxFONTENCODING_MACROMAN
;
472 case kTextEncodingMacJapanese
:
473 enc
= wxFONTENCODING_MACJAPANESE
;
475 case kTextEncodingMacChineseTrad
:
476 enc
= wxFONTENCODING_MACCHINESETRAD
;
478 case kTextEncodingMacKorean
:
479 enc
= wxFONTENCODING_MACKOREAN
;
481 case kTextEncodingMacArabic
:
482 enc
=wxFONTENCODING_MACARABIC
;
484 case kTextEncodingMacHebrew
:
485 enc
= wxFONTENCODING_MACHEBREW
;
487 case kTextEncodingMacGreek
:
488 enc
= wxFONTENCODING_MACGREEK
;
490 case kTextEncodingMacCyrillic
:
491 enc
= wxFONTENCODING_MACCYRILLIC
;
493 case kTextEncodingMacDevanagari
:
494 enc
= wxFONTENCODING_MACDEVANAGARI
;
496 case kTextEncodingMacGurmukhi
:
497 enc
= wxFONTENCODING_MACGURMUKHI
;
499 case kTextEncodingMacGujarati
:
500 enc
= wxFONTENCODING_MACGUJARATI
;
502 case kTextEncodingMacOriya
:
503 enc
=wxFONTENCODING_MACORIYA
;
505 case kTextEncodingMacBengali
:
506 enc
=wxFONTENCODING_MACBENGALI
;
508 case kTextEncodingMacTamil
:
509 enc
= wxFONTENCODING_MACTAMIL
;
511 case kTextEncodingMacTelugu
:
512 enc
= wxFONTENCODING_MACTELUGU
;
514 case kTextEncodingMacKannada
:
515 enc
= wxFONTENCODING_MACKANNADA
;
517 case kTextEncodingMacMalayalam
:
518 enc
= wxFONTENCODING_MACMALAJALAM
;
520 case kTextEncodingMacSinhalese
:
521 enc
= wxFONTENCODING_MACSINHALESE
;
523 case kTextEncodingMacBurmese
:
524 enc
= wxFONTENCODING_MACBURMESE
;
526 case kTextEncodingMacKhmer
:
527 enc
= wxFONTENCODING_MACKHMER
;
529 case kTextEncodingMacThai
:
530 enc
= wxFONTENCODING_MACTHAI
;
532 case kTextEncodingMacLaotian
:
533 enc
= wxFONTENCODING_MACLAOTIAN
;
535 case kTextEncodingMacGeorgian
:
536 enc
= wxFONTENCODING_MACGEORGIAN
;
538 case kTextEncodingMacArmenian
:
539 enc
= wxFONTENCODING_MACARMENIAN
;
541 case kTextEncodingMacChineseSimp
:
542 enc
= wxFONTENCODING_MACCHINESESIMP
;
544 case kTextEncodingMacTibetan
:
545 enc
= wxFONTENCODING_MACTIBETAN
;
547 case kTextEncodingMacMongolian
:
548 enc
= wxFONTENCODING_MACMONGOLIAN
;
550 case kTextEncodingMacEthiopic
:
551 enc
= wxFONTENCODING_MACETHIOPIC
;
553 case kTextEncodingMacCentralEurRoman
:
554 enc
= wxFONTENCODING_MACCENTRALEUR
;
556 case kTextEncodingMacVietnamese
:
557 enc
= wxFONTENCODING_MACVIATNAMESE
;
559 case kTextEncodingMacExtArabic
:
560 enc
= wxFONTENCODING_MACARABICEXT
;
562 case kTextEncodingMacSymbol
:
563 enc
= wxFONTENCODING_MACSYMBOL
;
565 case kTextEncodingMacDingbats
:
566 enc
= wxFONTENCODING_MACDINGBATS
;
568 case kTextEncodingMacTurkish
:
569 enc
= wxFONTENCODING_MACTURKISH
;
571 case kTextEncodingMacCroatian
:
572 enc
= wxFONTENCODING_MACCROATIAN
;
574 case kTextEncodingMacIcelandic
:
575 enc
= wxFONTENCODING_MACICELANDIC
;
577 case kTextEncodingMacRomanian
:
578 enc
= wxFONTENCODING_MACROMANIAN
;
580 case kTextEncodingMacCeltic
:
581 enc
= wxFONTENCODING_MACCELTIC
;
583 case kTextEncodingMacGaelic
:
584 enc
= wxFONTENCODING_MACGAELIC
;
586 case kTextEncodingMacKeyboardGlyphs
:
587 enc
= wxFONTENCODING_MACKEYBOARD
;
595 // CFStringRefs (Carbon only)
598 // converts this string into a carbon foundation string with optional pc 2 mac encoding
599 void wxMacCFStringHolder::Assign( const wxString
&st
, wxFontEncoding
WXUNUSED_IN_UNICODE(encoding
) )
610 wxMacConvertNewlines13To10( &str
) ;
612 #if SIZEOF_WCHAR_T == 2
613 m_cfs
= CFStringCreateWithCharacters( kCFAllocatorDefault
,
614 (UniChar
*)str
.wc_str() , str
.Len() );
616 wxMBConvUTF16 converter
;
617 size_t unicharlen
= converter
.WC2MB( NULL
, str
.wc_str() , 0 ) ;
618 UniChar
*unibuf
= new UniChar
[ unicharlen
/ sizeof(UniChar
) + 1 ] ;
619 converter
.WC2MB( (char*)unibuf
, str
.wc_str() , unicharlen
) ;
620 m_cfs
= CFStringCreateWithCharacters( kCFAllocatorDefault
,
621 unibuf
, unicharlen
/ sizeof(UniChar
) ) ;
624 #else // not wxUSE_UNICODE
625 m_cfs
= CFStringCreateWithCString( kCFAllocatorSystemDefault
, str
.c_str() ,
626 wxMacGetSystemEncFromFontEnc( encoding
) ) ;
632 wxString
wxMacCFStringHolder::AsString(wxFontEncoding
WXUNUSED_IN_UNICODE(encoding
))
635 return wxEmptyString
;
637 Size cflen
= CFStringGetLength( m_cfs
) ;
642 #if SIZEOF_WCHAR_T == 2
643 buf
= new wxChar
[ cflen
+ 1 ] ;
644 CFStringGetCharacters( m_cfs
, CFRangeMake( 0 , cflen
) , (UniChar
*) buf
) ;
647 UniChar
* unibuf
= new UniChar
[ cflen
+ 1 ] ;
648 CFStringGetCharacters( m_cfs
, CFRangeMake( 0 , cflen
) , (UniChar
*) unibuf
) ;
650 wxMBConvUTF16 converter
;
651 noChars
= converter
.MB2WC( NULL
, (const char*)unibuf
, 0 ) ;
652 wxASSERT_MSG( noChars
!= wxCONV_FAILED
, _T("Unable to count the number of characters in this string!") );
653 buf
= new wxChar
[ noChars
+ 1 ] ;
654 noChars
= converter
.MB2WC( buf
, (const char*)unibuf
, noChars
+ 1 ) ;
655 wxASSERT_MSG( noChars
!= wxCONV_FAILED
, _T("Conversion of string failed!") );
660 CFStringGetBytes( m_cfs
, CFRangeMake(0, cflen
) , wxMacGetSystemEncFromFontEnc( encoding
) ,
661 '?' , false , NULL
, 0 , &cStrLen
) ;
662 buf
= new wxChar
[ cStrLen
+ 1 ] ;
663 CFStringGetBytes( m_cfs
, CFRangeMake(0, cflen
) , wxMacGetSystemEncFromFontEnc( encoding
) ,
664 '?' , false , (unsigned char*) buf
, cStrLen
, &cStrLen
) ;
669 wxString
result(buf
) ;
671 wxMacConvertNewlines10To13( &result
);
676 wxMacUniCharBuffer::wxMacUniCharBuffer( const wxString
&str
)
678 m_chars
= str
.length() ;
681 #if SIZEOF_WCHAR_T == 4
682 wxMBConvUTF16 converter
;
684 size_t unicharlen
= converter
.WC2MB( NULL
, str
.wc_str() , 0 ) ;
685 m_ubuf
= (UniChar
*) malloc( unicharlen
+ 2 ) ;
686 converter
.WC2MB( (char*) m_ubuf
, str
.wc_str(), unicharlen
+ 2 ) ;
688 const wxWCharBuffer wchar
= str
.wc_str( wxConvLocal
) ;
689 size_t unicharlen
= converter
.WC2MB( NULL
, wchar
.data() , 0 ) ;
690 m_ubuf
= (UniChar
*) malloc( unicharlen
+ 2 ) ;
691 converter
.WC2MB( (char*) m_ubuf
, wchar
.data() , unicharlen
+ 2 ) ;
693 m_chars
= unicharlen
/ 2 ;
694 #else // SIZEOF_WCHAR_T is then 2
696 m_ubuf
= malloc( m_chars
* 2 + 2 ) ;
697 memcpy( m_ubuf
, (UniChar
*) str
.wc_str() , m_chars
* 2 + 2 ) ;
699 wxWCharBuffer wchar
= str
.wc_str( wxConvLocal
) ;
700 m_chars
= wxWcslen( wchar
.data() ) ;
701 m_ubuf
= malloc( m_chars
* 2 + 2 ) ;
702 memcpy( m_ubuf
, (UniChar
*) wchar
.data() , m_chars
* 2 + 2 ) ;
707 wxMacUniCharBuffer::~wxMacUniCharBuffer()
712 UniCharArrayPtr
wxMacUniCharBuffer::GetBuffer()
717 UniCharCount
wxMacUniCharBuffer::GetChars()