Bytes count of a string

For developers using the Construct 2 Javascript SDK

Post » Fri Jul 03, 2015 3:27 am

@Ashley

Hi, I am looking on the counting of string bytes for official saving -
Code: Select all
cr.logexport("Saved state to IndexedDB storage (" + savingJson.length + " bytes)");


"savingJson.length" is the characters count of a string(savingJson). It might not the bytes count of this string.
Goodbye
B
111
S
28
G
295
Posts: 4,549
Reputation: 164,228

Post » Fri Jul 03, 2015 10:13 am

It's just for information purposes, I don't think it's that important. Besides the real byte length depends on the encoding, and IndexedDB may use something else like UTF-8 for storage, so you can't actually really tell!
Scirra Founder
B
408
S
242
G
92
Posts: 24,929
Reputation: 198,706


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests