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