1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/core/cfstring.cpp
3 // Purpose: wxCFStringHolder and other string functions
4 // Author: Stefan Csomor
6 // Created: 2004-10-29 (from code in src/osx/carbon/utils.cpp)
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 // Usage: Darwin (base library)
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
15 #include "wx/string.h"
22 #include "wx/osx/core/cfstring.h"
24 #include <CoreFoundation/CoreFoundation.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 CFStringEncoding 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
= kCFStringEncodingISOLatin1
;
82 case wxFONTENCODING_ISO8859_2
:
83 enc
= kCFStringEncodingISOLatin2
;
85 case wxFONTENCODING_ISO8859_3
:
86 enc
= kCFStringEncodingISOLatin3
;
88 case wxFONTENCODING_ISO8859_4
:
89 enc
= kCFStringEncodingISOLatin4
;
91 case wxFONTENCODING_ISO8859_5
:
92 enc
= kCFStringEncodingISOLatinCyrillic
;
94 case wxFONTENCODING_ISO8859_6
:
95 enc
= kCFStringEncodingISOLatinArabic
;
97 case wxFONTENCODING_ISO8859_7
:
98 enc
= kCFStringEncodingISOLatinGreek
;
100 case wxFONTENCODING_ISO8859_8
:
101 enc
= kCFStringEncodingISOLatinHebrew
;
103 case wxFONTENCODING_ISO8859_9
:
104 enc
= kCFStringEncodingISOLatin5
;
106 case wxFONTENCODING_ISO8859_10
:
107 enc
= kCFStringEncodingISOLatin6
;
109 case wxFONTENCODING_ISO8859_13
:
110 enc
= kCFStringEncodingISOLatin7
;
112 case wxFONTENCODING_ISO8859_14
:
113 enc
= kCFStringEncodingISOLatin8
;
115 case wxFONTENCODING_ISO8859_15
:
116 enc
= kCFStringEncodingISOLatin9
;
119 case wxFONTENCODING_KOI8
:
120 enc
= kCFStringEncodingKOI8_R
;
122 case wxFONTENCODING_ALTERNATIVE
: // MS-DOS CP866
123 enc
= kCFStringEncodingDOSRussian
;
126 case wxFONTENCODING_BULGARIAN :
130 case wxFONTENCODING_CP437
:
131 enc
=kCFStringEncodingDOSLatinUS
;
133 case wxFONTENCODING_CP850
:
134 enc
= kCFStringEncodingDOSLatin1
;
136 case wxFONTENCODING_CP852
:
137 enc
= kCFStringEncodingDOSLatin2
;
139 case wxFONTENCODING_CP855
:
140 enc
= kCFStringEncodingDOSCyrillic
;
142 case wxFONTENCODING_CP866
:
143 enc
=kCFStringEncodingDOSRussian
;
145 case wxFONTENCODING_CP874
:
146 enc
= kCFStringEncodingDOSThai
;
148 case wxFONTENCODING_CP932
:
149 enc
= kCFStringEncodingDOSJapanese
;
151 case wxFONTENCODING_CP936
:
152 enc
= kCFStringEncodingDOSChineseSimplif
;
154 case wxFONTENCODING_CP949
:
155 enc
= kCFStringEncodingDOSKorean
;
157 case wxFONTENCODING_CP950
:
158 enc
= kCFStringEncodingDOSChineseTrad
;
161 case wxFONTENCODING_CP1250
:
162 enc
= kCFStringEncodingWindowsLatin2
;
164 case wxFONTENCODING_CP1251
:
165 enc
=kCFStringEncodingWindowsCyrillic
;
167 case wxFONTENCODING_CP1252
:
168 enc
=kCFStringEncodingWindowsLatin1
;
170 case wxFONTENCODING_CP1253
:
171 enc
= kCFStringEncodingWindowsGreek
;
173 case wxFONTENCODING_CP1254
:
174 enc
= kCFStringEncodingWindowsLatin5
;
176 case wxFONTENCODING_CP1255
:
177 enc
=kCFStringEncodingWindowsHebrew
;
179 case wxFONTENCODING_CP1256
:
180 enc
=kCFStringEncodingWindowsArabic
;
182 case wxFONTENCODING_CP1257
:
183 enc
= kCFStringEncodingWindowsBalticRim
;
186 case wxFONTENCODING_UTF7
:
187 enc
= CreateTextEncoding(kCFStringEncodingUnicodeDefault
,0,kUnicodeUTF7Format
) ;
190 case wxFONTENCODING_UTF8
:
191 enc
= kCFStringEncodingUTF8
;
193 case wxFONTENCODING_EUC_JP
:
194 enc
= kCFStringEncodingEUC_JP
;
196 case wxFONTENCODING_UTF16BE
:
197 enc
= kCFStringEncodingUTF16BE
;
199 case wxFONTENCODING_UTF16LE
:
200 enc
= kCFStringEncodingUTF16LE
;
202 case wxFONTENCODING_UTF32BE
:
203 enc
= kCFStringEncodingUTF32BE
;
205 case wxFONTENCODING_UTF32LE
:
206 enc
= kCFStringEncodingUTF32LE
;
209 case wxFONTENCODING_MACROMAN
:
210 enc
= kCFStringEncodingMacRoman
;
212 case wxFONTENCODING_MACJAPANESE
:
213 enc
= kCFStringEncodingMacJapanese
;
215 case wxFONTENCODING_MACCHINESETRAD
:
216 enc
= kCFStringEncodingMacChineseTrad
;
218 case wxFONTENCODING_MACKOREAN
:
219 enc
= kCFStringEncodingMacKorean
;
221 case wxFONTENCODING_MACARABIC
:
222 enc
= kCFStringEncodingMacArabic
;
224 case wxFONTENCODING_MACHEBREW
:
225 enc
= kCFStringEncodingMacHebrew
;
227 case wxFONTENCODING_MACGREEK
:
228 enc
= kCFStringEncodingMacGreek
;
230 case wxFONTENCODING_MACCYRILLIC
:
231 enc
= kCFStringEncodingMacCyrillic
;
233 case wxFONTENCODING_MACDEVANAGARI
:
234 enc
= kCFStringEncodingMacDevanagari
;
236 case wxFONTENCODING_MACGURMUKHI
:
237 enc
= kCFStringEncodingMacGurmukhi
;
239 case wxFONTENCODING_MACGUJARATI
:
240 enc
= kCFStringEncodingMacGujarati
;
242 case wxFONTENCODING_MACORIYA
:
243 enc
= kCFStringEncodingMacOriya
;
245 case wxFONTENCODING_MACBENGALI
:
246 enc
= kCFStringEncodingMacBengali
;
248 case wxFONTENCODING_MACTAMIL
:
249 enc
= kCFStringEncodingMacTamil
;
251 case wxFONTENCODING_MACTELUGU
:
252 enc
= kCFStringEncodingMacTelugu
;
254 case wxFONTENCODING_MACKANNADA
:
255 enc
= kCFStringEncodingMacKannada
;
257 case wxFONTENCODING_MACMALAJALAM
:
258 enc
= kCFStringEncodingMacMalayalam
;
260 case wxFONTENCODING_MACSINHALESE
:
261 enc
= kCFStringEncodingMacSinhalese
;
263 case wxFONTENCODING_MACBURMESE
:
264 enc
= kCFStringEncodingMacBurmese
;
266 case wxFONTENCODING_MACKHMER
:
267 enc
= kCFStringEncodingMacKhmer
;
269 case wxFONTENCODING_MACTHAI
:
270 enc
= kCFStringEncodingMacThai
;
272 case wxFONTENCODING_MACLAOTIAN
:
273 enc
= kCFStringEncodingMacLaotian
;
275 case wxFONTENCODING_MACGEORGIAN
:
276 enc
= kCFStringEncodingMacGeorgian
;
278 case wxFONTENCODING_MACARMENIAN
:
279 enc
= kCFStringEncodingMacArmenian
;
281 case wxFONTENCODING_MACCHINESESIMP
:
282 enc
= kCFStringEncodingMacChineseSimp
;
284 case wxFONTENCODING_MACTIBETAN
:
285 enc
= kCFStringEncodingMacTibetan
;
287 case wxFONTENCODING_MACMONGOLIAN
:
288 enc
= kCFStringEncodingMacMongolian
;
290 case wxFONTENCODING_MACETHIOPIC
:
291 enc
= kCFStringEncodingMacEthiopic
;
293 case wxFONTENCODING_MACCENTRALEUR
:
294 enc
= kCFStringEncodingMacCentralEurRoman
;
296 case wxFONTENCODING_MACVIATNAMESE
:
297 enc
= kCFStringEncodingMacVietnamese
;
299 case wxFONTENCODING_MACARABICEXT
:
300 enc
= kCFStringEncodingMacExtArabic
;
302 case wxFONTENCODING_MACSYMBOL
:
303 enc
= kCFStringEncodingMacSymbol
;
305 case wxFONTENCODING_MACDINGBATS
:
306 enc
= kCFStringEncodingMacDingbats
;
308 case wxFONTENCODING_MACTURKISH
:
309 enc
= kCFStringEncodingMacTurkish
;
311 case wxFONTENCODING_MACCROATIAN
:
312 enc
= kCFStringEncodingMacCroatian
;
314 case wxFONTENCODING_MACICELANDIC
:
315 enc
= kCFStringEncodingMacIcelandic
;
317 case wxFONTENCODING_MACROMANIAN
:
318 enc
= kCFStringEncodingMacRomanian
;
320 case wxFONTENCODING_MACCELTIC
:
321 enc
= kCFStringEncodingMacCeltic
;
323 case wxFONTENCODING_MACGAELIC
:
324 enc
= kCFStringEncodingMacGaelic
;
326 case wxFONTENCODING_MACKEYBOARD
:
327 enc
= 41; /* kTextEncodingMacKeyboardGlyphs ; */
329 default : // to make gcc happy
335 wxFontEncoding
wxMacGetFontEncFromSystemEnc(wxUint32 encoding
)
337 wxFontEncoding enc
= wxFONTENCODING_DEFAULT
;
341 case kCFStringEncodingISOLatin1
:
342 enc
= wxFONTENCODING_ISO8859_1
;
344 case kCFStringEncodingISOLatin2
:
345 enc
= wxFONTENCODING_ISO8859_2
;
347 case kCFStringEncodingISOLatin3
:
348 enc
= wxFONTENCODING_ISO8859_3
;
350 case kCFStringEncodingISOLatin4
:
351 enc
= wxFONTENCODING_ISO8859_4
;
353 case kCFStringEncodingISOLatinCyrillic
:
354 enc
= wxFONTENCODING_ISO8859_5
;
356 case kCFStringEncodingISOLatinArabic
:
357 enc
= wxFONTENCODING_ISO8859_6
;
359 case kCFStringEncodingISOLatinGreek
:
360 enc
= wxFONTENCODING_ISO8859_7
;
362 case kCFStringEncodingISOLatinHebrew
:
363 enc
= wxFONTENCODING_ISO8859_8
;
365 case kCFStringEncodingISOLatin5
:
366 enc
= wxFONTENCODING_ISO8859_9
;
368 case kCFStringEncodingISOLatin6
:
369 enc
= wxFONTENCODING_ISO8859_10
;
371 case kCFStringEncodingISOLatin7
:
372 enc
= wxFONTENCODING_ISO8859_13
;
374 case kCFStringEncodingISOLatin8
:
375 enc
= wxFONTENCODING_ISO8859_14
;
377 case kCFStringEncodingISOLatin9
:
378 enc
=wxFONTENCODING_ISO8859_15
;
381 case kCFStringEncodingKOI8_R
:
382 enc
= wxFONTENCODING_KOI8
;
386 enc = wxFONTENCODING_BULGARIAN;
389 case kCFStringEncodingDOSLatinUS
:
390 enc
= wxFONTENCODING_CP437
;
392 case kCFStringEncodingDOSLatin1
:
393 enc
= wxFONTENCODING_CP850
;
395 case kCFStringEncodingDOSLatin2
:
396 enc
=wxFONTENCODING_CP852
;
398 case kCFStringEncodingDOSCyrillic
:
399 enc
= wxFONTENCODING_CP855
;
401 case kCFStringEncodingDOSRussian
:
402 enc
= wxFONTENCODING_CP866
;
404 case kCFStringEncodingDOSThai
:
405 enc
=wxFONTENCODING_CP874
;
407 case kCFStringEncodingDOSJapanese
:
408 enc
= wxFONTENCODING_CP932
;
410 case kCFStringEncodingDOSChineseSimplif
:
411 enc
= wxFONTENCODING_CP936
;
413 case kCFStringEncodingDOSKorean
:
414 enc
= wxFONTENCODING_CP949
;
416 case kCFStringEncodingDOSChineseTrad
:
417 enc
= wxFONTENCODING_CP950
;
420 case kCFStringEncodingWindowsLatin2
:
421 enc
= wxFONTENCODING_CP1250
;
423 case kCFStringEncodingWindowsCyrillic
:
424 enc
= wxFONTENCODING_CP1251
;
426 case kCFStringEncodingWindowsLatin1
:
427 enc
= wxFONTENCODING_CP1252
;
429 case kCFStringEncodingWindowsGreek
:
430 enc
= wxFONTENCODING_CP1253
;
432 case kCFStringEncodingWindowsLatin5
:
433 enc
= wxFONTENCODING_CP1254
;
435 case kCFStringEncodingWindowsHebrew
:
436 enc
= wxFONTENCODING_CP1255
;
438 case kCFStringEncodingWindowsArabic
:
439 enc
= wxFONTENCODING_CP1256
;
441 case kCFStringEncodingWindowsBalticRim
:
442 enc
=wxFONTENCODING_CP1257
;
444 case kCFStringEncodingEUC_JP
:
445 enc
= wxFONTENCODING_EUC_JP
;
448 case kCFStringEncodingUTF8
:
449 enc
= wxFONTENCODING_UTF8
;
451 case kCFStringEncodingUTF16BE
:
452 enc
= wxFONTENCODING_UTF16BE
;
454 case kCFStringEncodingUTF16LE
:
455 enc
= wxFONTENCODING_UTF16LE
;
457 case kCFStringEncodingUTF32BE
:
458 enc
= wxFONTENCODING_UTF32BE
;
460 case kCFStringEncodingUTF32LE
:
461 enc
= wxFONTENCODING_UTF32LE
;
465 case wxFONTENCODING_UTF7
:
466 enc
= CreateTextEncoding(kCFStringEncodingUnicodeDefault
,0,kUnicodeUTF7Format
) ;
469 case kCFStringEncodingMacRoman
:
470 enc
= wxFONTENCODING_MACROMAN
;
472 case kCFStringEncodingMacJapanese
:
473 enc
= wxFONTENCODING_MACJAPANESE
;
475 case kCFStringEncodingMacChineseTrad
:
476 enc
= wxFONTENCODING_MACCHINESETRAD
;
478 case kCFStringEncodingMacKorean
:
479 enc
= wxFONTENCODING_MACKOREAN
;
481 case kCFStringEncodingMacArabic
:
482 enc
=wxFONTENCODING_MACARABIC
;
484 case kCFStringEncodingMacHebrew
:
485 enc
= wxFONTENCODING_MACHEBREW
;
487 case kCFStringEncodingMacGreek
:
488 enc
= wxFONTENCODING_MACGREEK
;
490 case kCFStringEncodingMacCyrillic
:
491 enc
= wxFONTENCODING_MACCYRILLIC
;
493 case kCFStringEncodingMacDevanagari
:
494 enc
= wxFONTENCODING_MACDEVANAGARI
;
496 case kCFStringEncodingMacGurmukhi
:
497 enc
= wxFONTENCODING_MACGURMUKHI
;
499 case kCFStringEncodingMacGujarati
:
500 enc
= wxFONTENCODING_MACGUJARATI
;
502 case kCFStringEncodingMacOriya
:
503 enc
=wxFONTENCODING_MACORIYA
;
505 case kCFStringEncodingMacBengali
:
506 enc
=wxFONTENCODING_MACBENGALI
;
508 case kCFStringEncodingMacTamil
:
509 enc
= wxFONTENCODING_MACTAMIL
;
511 case kCFStringEncodingMacTelugu
:
512 enc
= wxFONTENCODING_MACTELUGU
;
514 case kCFStringEncodingMacKannada
:
515 enc
= wxFONTENCODING_MACKANNADA
;
517 case kCFStringEncodingMacMalayalam
:
518 enc
= wxFONTENCODING_MACMALAJALAM
;
520 case kCFStringEncodingMacSinhalese
:
521 enc
= wxFONTENCODING_MACSINHALESE
;
523 case kCFStringEncodingMacBurmese
:
524 enc
= wxFONTENCODING_MACBURMESE
;
526 case kCFStringEncodingMacKhmer
:
527 enc
= wxFONTENCODING_MACKHMER
;
529 case kCFStringEncodingMacThai
:
530 enc
= wxFONTENCODING_MACTHAI
;
532 case kCFStringEncodingMacLaotian
:
533 enc
= wxFONTENCODING_MACLAOTIAN
;
535 case kCFStringEncodingMacGeorgian
:
536 enc
= wxFONTENCODING_MACGEORGIAN
;
538 case kCFStringEncodingMacArmenian
:
539 enc
= wxFONTENCODING_MACARMENIAN
;
541 case kCFStringEncodingMacChineseSimp
:
542 enc
= wxFONTENCODING_MACCHINESESIMP
;
544 case kCFStringEncodingMacTibetan
:
545 enc
= wxFONTENCODING_MACTIBETAN
;
547 case kCFStringEncodingMacMongolian
:
548 enc
= wxFONTENCODING_MACMONGOLIAN
;
550 case kCFStringEncodingMacEthiopic
:
551 enc
= wxFONTENCODING_MACETHIOPIC
;
553 case kCFStringEncodingMacCentralEurRoman
:
554 enc
= wxFONTENCODING_MACCENTRALEUR
;
556 case kCFStringEncodingMacVietnamese
:
557 enc
= wxFONTENCODING_MACVIATNAMESE
;
559 case kCFStringEncodingMacExtArabic
:
560 enc
= wxFONTENCODING_MACARABICEXT
;
562 case kCFStringEncodingMacSymbol
:
563 enc
= wxFONTENCODING_MACSYMBOL
;
565 case kCFStringEncodingMacDingbats
:
566 enc
= wxFONTENCODING_MACDINGBATS
;
568 case kCFStringEncodingMacTurkish
:
569 enc
= wxFONTENCODING_MACTURKISH
;
571 case kCFStringEncodingMacCroatian
:
572 enc
= wxFONTENCODING_MACCROATIAN
;
574 case kCFStringEncodingMacIcelandic
:
575 enc
= wxFONTENCODING_MACICELANDIC
;
577 case kCFStringEncodingMacRomanian
:
578 enc
= wxFONTENCODING_MACROMANIAN
;
580 case kCFStringEncodingMacCeltic
:
581 enc
= wxFONTENCODING_MACCELTIC
;
583 case kCFStringEncodingMacGaelic
:
584 enc
= wxFONTENCODING_MACGAELIC
;
586 case 41 /* kTextEncodingMacKeyboardGlyphs */ :
587 enc
= wxFONTENCODING_MACKEYBOARD
;
598 // converts this string into a core foundation string with optional pc 2 mac encoding
600 wxCFStringRef::wxCFStringRef( const wxString
&st
, wxFontEncoding
WXUNUSED_IN_UNICODE(encoding
) )
604 reset( wxCFRetain( CFSTR("") ) );
609 wxMacConvertNewlines13To10( &str
) ;
611 #if wxUSE_UNICODE_WCHAR
612 // native = wchar_t 4 bytes for us
613 const wchar_t * const data
= str
.wc_str();
614 const size_t size
= str
.length()*sizeof(wchar_t);
615 CFStringBuiltInEncodings cfencoding
= kCFStringEncodingUTF32Native
;
616 #elif wxUSE_UNICODE_UTF8
618 const char * const data
= str
.utf8_str();
619 const size_t size
= str
.utf8_length();
620 CFStringBuiltInEncodings cfencoding
= kCFStringEncodingUTF8
;
622 #error "unsupported Unicode representation"
625 reset( CFStringCreateWithBytes( kCFAllocatorDefault
,
626 (const UInt8
*)data
, size
, cfencoding
, false /* no BOM */ ) );
627 #else // not wxUSE_UNICODE
628 reset( CFStringCreateWithCString( kCFAllocatorSystemDefault
, str
.c_str() ,
629 wxMacGetSystemEncFromFontEnc( encoding
) ) );
634 wxString
wxCFStringRef::AsStringWithNormalizationFormC( CFStringRef ref
, wxFontEncoding encoding
)
637 return wxEmptyString
;
639 CFMutableStringRef cfMutableString
= CFStringCreateMutableCopy(NULL
, 0, ref
);
640 CFStringNormalize(cfMutableString
,kCFStringNormalizationFormC
);
641 wxString str
= wxCFStringRef::AsString(ref
,encoding
);
642 CFRelease(cfMutableString
);
646 wxString
wxCFStringRef::AsString( CFStringRef ref
, wxFontEncoding
WXUNUSED_IN_UNICODE(encoding
) )
649 return wxEmptyString
;
651 Size cflen
= CFStringGetLength( ref
) ;
653 CFStringEncoding cfencoding
;
656 #if wxUSE_UNICODE_WCHAR
657 cfencoding
= kCFStringEncodingUTF32Native
;
658 #elif wxUSE_UNICODE_UTF8
659 cfencoding
= kCFStringEncodingUTF8
;
661 #error "unsupported unicode representation"
664 cfencoding
= wxMacGetSystemEncFromFontEnc( encoding
);
668 CFStringGetBytes( ref
, CFRangeMake(0, cflen
) , cfencoding
,
669 '?' , false , NULL
, 0 , &cStrLen
) ;
670 char* buf
= new char[cStrLen
];
671 CFStringGetBytes( ref
, CFRangeMake(0, cflen
) , cfencoding
,
672 '?' , false , (unsigned char*) buf
, cStrLen
, &cStrLen
) ;
675 #if wxUSE_UNICODE_WCHAR
676 result
= wxString( (const wchar_t*) buf
, cStrLen
/4);
677 #elif wxUSE_UNICODE_UTF8
678 result
= wxString::FromUTF8( buf
, cStrLen
);
680 #error "unsupported unicode representation"
683 result
= wxString(buf
, cStrLen
) ;
687 wxMacConvertNewlines10To13( &result
);
691 wxString
wxCFStringRef::AsString(wxFontEncoding encoding
) const
693 return AsString( get(), encoding
);
696 #if wxOSX_USE_COCOA_OR_IPHONE
697 wxString
wxCFStringRef::AsString( NSString
* ref
, wxFontEncoding encoding
)
699 return AsString( (CFStringRef
) ref
, encoding
);
702 wxString
wxCFStringRef::AsStringWithNormalizationFormC( NSString
* ref
, wxFontEncoding encoding
)
704 return AsStringWithNormalizationFormC( (CFStringRef
) ref
, encoding
);
706 #endif // wxOSX_USE_COCOA_OR_IPHONE
710 // wxMacUniCharBuffer
713 wxMacUniCharBuffer::wxMacUniCharBuffer( const wxString
&str
)
715 wxMBConvUTF16 converter
;
717 size_t unicharlen
= converter
.WC2MB( NULL
, str
.wc_str() , 0 ) ;
718 m_ubuf
= (UniChar
*) malloc( unicharlen
+ 2 ) ;
719 converter
.WC2MB( (char*) m_ubuf
, str
.wc_str(), unicharlen
+ 2 ) ;
721 const wxWCharBuffer wchar
= str
.wc_str( wxConvLocal
) ;
722 size_t unicharlen
= converter
.WC2MB( NULL
, wchar
.data() , 0 ) ;
723 m_ubuf
= (UniChar
*) malloc( unicharlen
+ 2 ) ;
724 converter
.WC2MB( (char*) m_ubuf
, wchar
.data() , unicharlen
+ 2 ) ;
726 m_chars
= unicharlen
/ 2 ;
729 wxMacUniCharBuffer::~wxMacUniCharBuffer()
734 UniCharPtr
wxMacUniCharBuffer::GetBuffer()
739 UniCharCount
wxMacUniCharBuffer::GetChars()