🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1577

Need a help, fopen and unicode

#1577
From: Eriks Aleksans
Date: Wed, 18 Jul 2007 11:06
38 lines
1732 bytes
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?).

TIA
Eriks
Technical Details
Message-ID: <469df4d2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2684d17de03f931d,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 18 Jul 2007 14:06:48 +0300
From: Eriks Aleksans <eriks.aleksans@gmail.com>
User-Agent: Thunderbird 2.0.0.4 (Windows/20070604)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Need a help, fopen and unicode 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 83.241.15.228
Message-ID: <469df4d2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1184756946 83.241.15.228 (18 Jul 2007 04:09:06 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail