3DS File Loader unicode version ?

4 views
Skip to first unread message

Skybuck Flying

unread,
May 15, 2015, 9:04:04 AM5/15/15
to
Hello,

I need this converted to unicode:

http://www.soft-gems.net/index.php/libs/3ds-import-library

Can somebody with lots of ansistring to unicode experience help with that ?

I think problem zones will probably be:

"blockread" or "readblock" or "memcopy" or "move".

Probably stuff that deals with reading raw bytes and dumping it into a
string.

That would be my guess.

The original author no longer programs in Delphi.

However he is willing to put up a unicode version if somebody fixes it.

Bye,
Skybuck.

Skybuck Flying

unread,
May 21, 2015, 11:04:33 AM5/21/15
to
Hello,

While Delphi XE8 is installing I took a little look at the source code of
3ds import library, and it turns out only one little line needs to be
changed to fix the reading part of the library:

The fix is indicated by // *

The type was changed from Char (which is now unicode char in delphi xe) to
AnsiChar.

This fixes it ! HAHA... my code is now working again yeah.

function TFile3DS.ReadString: String;

var Len: Integer;
Buffer: array[Byte] of AnsiChar; // *

begin
Len := 0;
repeat
FStream.Read(Buffer[Len], 1);
Inc(Len);
until Buffer[Len - 1] = #0;
SetString(Result, Buffer, Len - 1); // not the null byte
end;

Bye,
Skybuck.

Reply all
Reply to author
Forward
0 new messages