#1 2016-01-09 08:23:42

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

[NOT-A-ISSUE] FormatUTF8 can't handle large INT64 values

Hi Arnaud,

A bug report.

The FormatUTF8() function defined in SynCommoms.pas cannot handle large int64 values such as 2119852951849248647

I'm using the latest rev. from github.com

Upate 1: Obviously I'm using this function in a wrong way - I thought it supports all types of arguments as supported by Format(), but actually it supports the "%" argument only.

Last edited by edwinsn (2016-01-09 11:50:40)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2016-01-09 08:59:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,666
Website

Re: [NOT-A-ISSUE] FormatUTF8 can't handle large INT64 values

I tried the following:

  Check(Int64ToUTF8(2119852951849248647)='2119852951849248647');
  Check(FormatUTF8(' % ',[2119852951849248647])=' 2119852951849248647 ');

See http://synopse.info/fossil/info/0dcc20a883
Without issue...

The problem seems elsewhere...

Please provide some code to reproduce the issue.

Offline

#3 2016-01-09 11:47:19

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: [NOT-A-ISSUE] FormatUTF8 can't handle large INT64 values

@ab, sorry, I thought FormatUTF8() is a *complete* counterpart of Format() and I used "%d", and just found this comment in the source code:

// only supported token is %, with any const arguments

Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#4 2016-01-09 13:35:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,666
Website

Re: [NOT-A-ISSUE] FormatUTF8 can't handle large INT64 values

Yes, we got rid of those %s %d %g details, which were more misleading and source of error at runtime...

Offline

#5 2016-01-09 14:30:27

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: [NOT-A-ISSUE] FormatUTF8 can't handle large INT64 values

ab wrote:

Yes, we got rid of those %s %d %g details, which were more misleading and source of error at runtime...

That's s good, error-tolerable design, well done!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB