Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Jsonize int64 surprise
Jsonize int64 surprise [message #38862] Thu, 24 January 2013 19:51 Go to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

It looks like jsonizing big int64 numbers leads to "string" representation instead of direct one.
I consider this bad kind of surprise as one's completely unable to send ANY big (int64) numbers to browser. I.e. you need to send some JSON containing javascript timestamp (which is really big int64 number) with int64 member. But you'll be surprised that this javascript code wont't work:
var d = new Date(receivedJson.t);

because t is not 1274574567221 but is a string '1274574567221'.

Looking into U++ core code reveals following:
		
//Core/JSON.cpp @ 238
if(var >= INT_MIN && var <= INT_MAX)
			io.Set(var);
		else
			io.Set(AsString(var));


I propose eliminating such a surprise party leaving int64 numbers as it is. Besides all known to me modern javascript implementations DO SUPPORT int64 integer numbers by default.

[Updated on: Thu, 24 January 2013 19:53]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is FrameLess() working under Linux ?
Next Topic: Request: completion 64 bit support in Draw and Stream
Goto Forum:
  


Current Time: Thu Apr 18 14:39:06 CEST 2024

Total time taken to generate the page: 0.01860 seconds