Solved

Unicode Path to Multibyte correct

Posted on 2010-11-25
3
406 Views
Last Modified: 2012-05-10
Hello,
a question about Paths: I have a Path with a greek word inside. This I have to pass to a DLL with Multibyte. But nothing is working. From:
C:\Users\¿¿¿S¿¿S\Desktop    <----sorry, please see attached image
I got:
C:\Users\?!?!?!\Desktop
Is it somehow possible to bring a Unicode String to A MultiByte DLL?
I read about "GetShortPathName" and functions like SetFileApisToOEM() or SetFileApisToANSI(), but I have no idea how. Any help is welcome.

Ocrana greek path
0
Comment
Question by:Ocrana
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 34213779
'WideCharToMultiByte()' (http://msdn.microsoft.com/en-us/library/dd374130%28VS.85%29.aspx) is what you would use here, e.g.
wchar_t awcPath[MAX_PATH] = L"c:\\path";

char acPath[MAX_PATH];



// codepage 869 is 'OEM Modern Greek', see http://msdn.microsoft.com/en-us/library/dd317756%28v=VS.85%29.aspx ("Code Page Identifiers")

WideCharToMultiByte(CP_869,WC_COMPOSITECHECK,awcPath,wcslen(awcPath),acPath,MAX_PATH,NULL,NULL);

Open in new window

0
 
LVL 5

Expert Comment

by:greatsubash
ID: 34215632
Please refer the below link, may be it is useful,
http://msdn.microsoft.com/en-us/library/ey142t48(VS.80).aspx
0
 

Author Closing Comment

by:Ocrana
ID: 34220360
ot the right codepage but easy to find. Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now