godot icon indicating copy to clipboard operation
godot copied to clipboard

string length can not more than 15k

Open sxmad opened this issue 12 years ago • 5 comments

var s = "" loop: s += temp_str
temp_str's length more than 15360 then print s,you can not get full string,and then you can get a string from s[0] to s[15360-1]

e.g. when I want to push a JSON file(the size more than 500K) from server to client(code by godot),the client can not get full file.

sxmad avatar Mar 31 '14 08:03 sxmad

var s = ""
for i in range(20000):
    s+="a"  
print("s.length: ", s.length())

Shows 20000 correctly.

Is it possible that your temp_str been truncated before loop?

marynate avatar Mar 31 '14 08:03 marynate

I received string from socket. var s = ""

func _process(): var output = socket.get_partial_data(1024) var outputData = output[1] var temp_str = outputData.get_string_from_utf8() s += temp_str

then I sent a long string from server to client. and I print it .but I can not see all of them.now ,I : print (s.right(s.length()-100)) then got the substr. so .I think the console can not show all. but the string not have this issue.

thank you!!! marynate!

sxmad avatar Mar 31 '14 09:03 sxmad

new message:

if print (s.right(s.length()-16380)) I can got the string in console(cmd). if print (s.right(s.length()-16381)) I can not got the string in console(cmd). in the output of godot ,it displayed.but I can not confirm it's a full string,because the output of godot not have a scroll bar. and some minutes later, the console output a string "lost ?".

sxmad avatar Mar 31 '14 09:03 sxmad

It seems to me that's the buffer size of windows console not big enough to hold output string.

marynate avatar Mar 31 '14 11:03 marynate

I think u r right!

sxmad avatar Mar 31 '14 15:03 sxmad