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.
B
110
S
28
G
280
Posts: 4,487
Reputation: 156,566

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
402
S
238
G
89
Posts: 24,622
Reputation: 196,011


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests