Discussion:
3DS File Loader unicode version ?
(too old to reply)
Skybuck Flying
2015-05-15 13:04:03 UTC
Permalink
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
2015-05-21 15:04:33 UTC
Permalink
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.

Loading...