image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old May 19th, 2008, 04:08 AM
Registered User
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sayan is on a distinguished road
Question how to convert UTF16 to UTF8 string without dataloss to use in fopen()

does anyone know how to convert UTF 16 string to UTF 8 string without data loss.??


i have converted ASCII string to UTF 16 string with following code ::

UniChar* ASCII2Uni(const char* filepath)
{

CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, filepath, kCFStringEncodingUTF16);

const UniChar* nameChars = CFStringGetCharactersPtr(name);
return nameChars;

}


Please inform me whether my ASCII2Uni is correct or not also ??
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 11:19 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.