Article View: borland.public.cppbuilder.nativeapi
Article #1578Re: Need a help, fopen and unicode
From: Ed Mulroy [TeamB]
Date: Wed, 18 Jul 2007 12:45
Date: Wed, 18 Jul 2007 12:45
42 lines
2036 bytes
2036 bytes
Just a guess but try using _wfopen instead and define UNICODE in the project
options.
. Ed
> Eriks Aleksans wrote in message
> news:469df4d2@newsgroups.borland.com...
> Hi,
>
> I need a help on this.
> Here's a peace of code from BladeMP3EncDLL.c (from lame-3.97 project)
>
>
> __declspec(dllexport) BE_ERR beWriteInfoTag( HBE_STREAM hbeStream,
> LPCSTR lpszFileName )
> {
> FILE* fpStream = NULL;
> BE_ERR beResult = BE_ERR_SUCCESSFUL;
>
> lame_global_flags* gfp = (lame_global_flags*)hbeStream;
>
>
> if ( NULL == gfp )
> }
> if ( NULL != gfp )
> {
> // Do we have to write the VBR tag?
> if ( lame_get_bWriteVbrTag( gfp ) )
> {
>
> // Try to open the file
> fpStream=fopen( lpszFileName, "rb+" );
>
> .....
>
>
> I'm calling this DLL from Delphi and it works just fine with non-unicode
> file names.
>
> My question is how to change this C part so it will accept unicode
> filename and will open it as well. As I understand fopen does not work
> with unicode (or am I wrong?).
Technical Details
Message-ID:
<469e0b4f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<469df4d2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2684d17de03f931d X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <469df4d2@newsgroups.borland.com> Subject: Re: Need a help, fopen and unicode Date: Wed, 18 Jul 2007 08:45:04 -0400 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 69.142.254.168 Message-ID: <469e0b4f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1184762703 69.142.254.168 (18 Jul 2007 05:45:03 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 1891