Discussion:
U icode support for Cabinet SDK
(too old to reply)
Karthik
2006-06-27 09:49:47 UTC
Permalink
Hi,

I need to extract a CAB file programatically. The CAB file's name may
contain unicode characters too. We are planning to use Cabinet SDK to
perform the extraction.
While going through the MSDN, I found that FDI API's in Cabinet SDK
dont support unicode.
All those functions take file name as (char *).


How could I extract a CAB file, whose name may contain unicode
characters?


Regards
Karthik
Tom Serface
2006-06-27 15:33:33 UTC
Permalink
http://msdn2.microsoft.com/en-us/library/3h8ff753.aspx

Tom
Post by Karthik
Hi,
I need to extract a CAB file programatically. The CAB file's name may
contain unicode characters too. We are planning to use Cabinet SDK to
perform the extraction.
While going through the MSDN, I found that FDI API's in Cabinet SDK
dont support unicode.
All those functions take file name as (char *).
How could I extract a CAB file, whose name may contain unicode
characters?
Regards
Karthik
Mihai N.
2006-07-01 08:41:18 UTC
Permalink
Post by Karthik
I need to extract a CAB file programatically. The CAB file's name may
contain unicode characters too. We are planning to use Cabinet SDK to
perform the extraction.
While going through the MSDN, I found that FDI API's in Cabinet SDK
dont support unicode.
All those functions take file name as (char *).
How could I extract a CAB file, whose name may contain unicode
characters?
The files names inside the cab use code pages. The cab file format does not
support unicode. And the msi databases do not support unicode:
http://blogs.msdn.com/michkap/archive/2005/10/08/478479.aspx
http://blogs.msdn.com/heaths/archive/2005/10/05/477577.aspx

"Unofficially, MSI databases do support UTF-7 and UTF-8 by specifying code
pages 65000 and 65001, respectively"
Maybe the msi databases do support utf-8, but the MS tools used to create msi
files do not. And neither does InstallShield.


For the .cab file itself, SetupIterateCabinet takes a PCTSTR CabinetFile, so
it seems Unicode is ok (I have not tried it though).
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Karthik
2006-07-10 05:21:32 UTC
Permalink
Post by Mihai N.
For the .cab file itself, SetupIterateCabinet takes a PCTSTR CabinetFile, so
it seems Unicode is ok (I have not tried it though).
I'm able to extract a cabinet file (whose files name contains Unicode
characters), with Setup API.
But, just I want to know, "Is the same possible using Cabinet SDK?,
which is a dedicated SDK for building cabinet file management tools"

Thanks
Karthik.
Karthik
2006-07-10 05:32:13 UTC
Permalink
Post by Mihai N.
For the .cab file itself, SetupIterateCabinet takes a PCTSTR CabinetFile, so
it seems Unicode is ok (I have not tried it though).
I'm able to extract a cabinet file (whose files name contains Unicode
characters), with Setup API.
But, just I want to know, "Is the same possible using Cabinet SDK?,
which is a dedicated SDK for building cabinet file management tools"
I get compilation errors, when I tried to invoke Cabinet SDK functions
in an UNICODE project.

This is the signature of the function which extracts a cabinet file,
BOOL FDICopy(
HFDI hfdi,
char FAR* pszCabinet,
char FAR* pszCabPath,
int flags,
PFNFDINOTIFY pfnfdin,
PFNFDIDECRYPT pfnfdid,
void FAR pvUser
);

As you see, the file path argument is a (char *). So, can I assume also
that Cabinet SDK is not Unicode compatible??

Thanks
Karthik.
Mihai N.
2006-07-10 08:49:39 UTC
Permalink
Post by Karthik
But, just I want to know, "Is the same possible using Cabinet SDK?,
which is a dedicated SDK for building cabinet file management tools"
I get compilation errors, when I tried to invoke Cabinet SDK functions
in an UNICODE project.
...
Post by Karthik
As you see, the file path argument is a (char *). So, can I assume also
that Cabinet SDK is not Unicode compatible??
I am afraid so. I know the CAB area is not that Unicode smart.

On the other side, checking Fdi.h, I was able to find something
a define of _A_NAME_IS_UTF and the comment
"FAT file attribute flag used by FCI/FDI to indicate that
the filename in the CAB is a UTF string"

No clue how to use this.
See also here (search for UTF):
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dncompapi/html/comp_cab.asp
So it seems that if _A_NAME_IS_UTF is part of the file attribute in the CAB
file, then you can also use utf-8 in your api. No clue what can you do if
there is no _A_NAME_IS_UTF in the file attribute.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Karthik
2006-07-10 05:39:06 UTC
Permalink
Post by Mihai N.
For the .cab file itself, SetupIterateCabinet takes a PCTSTR CabinetFile, so
it seems Unicode is ok (I have not tried it though).
I'm able to extract a cabinet file (whose files name contains Unicode
characters), with Setup API.
But, just I want to know, "Is the same possible using Cabinet SDK?,
which is a dedicated SDK for building cabinet file management tools"
I get compilation errors, when I tried to invoke Cabinet SDK functions
in an UNICODE project.

This is the signature of the function which extracts a cabinet file,
BOOL FDICopy(
HFDI hfdi,
char FAR* pszCabinet,
char FAR* pszCabPath,
int flags,
PFNFDINOTIFY pfnfdin,
PFNFDIDECRYPT pfnfdid,
void FAR pvUser
);

As you see, the file path argument is a (char *). So, can I assume also
that Cabinet SDK is not Unicode compatible??

Thanks
Karthik.
Loading...