- Posts: 93
- Thank you received: 10
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Radee native lib crash on Document#getOutlineDest()
IP: 93.42.249.223
6 years 2 weeks ago #14940
by luca.f
Replied by luca.f on topic Radee native lib crash on Document#getOutlineDest()
Dear user, the new
beta
has been released. Let us know if this fixes the issue.
IP: 221.127.83.11
6 years 2 weeks ago #14942
by AnypadDev
Replied by AnypadDev on topic Radee native lib crash on Document#getOutlineDest()
From a quick test using the beta on the attached file, app no longer crashes. Thank you.
May we ask what CJK character actually triggered the crash? And will the crash happen on other characters?
And by length, what is maximum length? And is there any way we can check this before using the API GetDest() to prevent the crash from happening again?
Thanks
May we ask what CJK character actually triggered the crash? And will the crash happen on other characters?
And by length, what is maximum length? And is there any way we can check this before using the API GetDest() to prevent the crash from happening again?
Thanks
IP: 111.196.247.3
6 years 2 weeks ago - 6 years 2 weeks ago #14943
by radaee
Replied by radaee on topic Radee native lib crash on Document#getOutlineDest()
dear user:
crash not caused by GetDest(), but caused by OutlineItem.GetTitle(); which return label of outline item.
the beta version can max to 4092 utf16 or 8180 utf8-chars, longer than 8180 maybe cut.
that mean max latin chars to 4092, and max utf8 in CJK to 8180.
the old version has buffer 1024 and max to 1023 utf8 chars, if last utf16 char is CJK, when convert to utf8, buffer will be overflow.
the beta version has 8192 buffer size, and cut to 8180.
crash not caused by GetDest(), but caused by OutlineItem.GetTitle(); which return label of outline item.
the beta version can max to 4092 utf16 or 8180 utf8-chars, longer than 8180 maybe cut.
that mean max latin chars to 4092, and max utf8 in CJK to 8180.
the old version has buffer 1024 and max to 1023 utf8 chars, if last utf16 char is CJK, when convert to utf8, buffer will be overflow.
the beta version has 8192 buffer size, and cut to 8180.
Last edit: 6 years 2 weeks ago by radaee.
IP: 221.127.83.11
6 years 1 week ago #14947
by AnypadDev
Can you explain further?
From doing a quick Javascript check, the bookmark text has a length of 382, but with UTF encoding, its byte size is only 938.
thanks
Replied by AnypadDev on topic Radee native lib crash on Document#getOutlineDest()
radaee wrote: the old version has buffer 1024 and max to 1023 utf8 chars, if last utf16 char is CJK, when convert to utf8, buffer will be overflow.
the beta version has 8192 buffer size, and cut to 8180.
Can you explain further?
- Is the max 1023 utf8 chars per outline title?
- So if we used utf16, this would be max of 512 utf16 chars?
- Can you give a computation with our example document? Because the original document actually contains a bookmark item that's longer than the one I attached, but it didn't cause a crash. So I'm wondering if its a specific CJK character? or maybe I computed incorrectly.
From doing a quick Javascript check, the bookmark text has a length of 382, but with UTF encoding, its byte size is only 938.
Code:
var str = ...; // the chinese outline text
console.log(str.length); // this prints "317"
console.log(new Blob([str]).size); // this prints "938". Which is below the max 1023 you mentioned
thanks
IP: 111.196.247.3
6 years 1 week ago - 6 years 1 week ago #14948
by radaee
Replied by radaee on topic Radee native lib crash on Document#getOutlineDest()
sorry, i better checked old codes, and found utf16 has 512 buffer, utf8 has 512 buffer too, not 1024.
this behaviour in JNI wrap codes.
that mean, overflow happen when add utf8 at 511 position.
this behaviour in JNI wrap codes.
that mean, overflow happen when add utf8 at 511 position.
Last edit: 6 years 1 week ago by radaee.
IP: 210.177.148.233
6 years 1 week ago #14951
by AnypadDev
Thanks. can you give me an example of a problematic string? I tried an Outline title of 120k English characters but it didn't crash. Then I appended a CJK character at the end, it still didn't crash.
* Do you have a timeline for the next stable release?
* What workaround can you recommend to clients?
Thanks
Replied by AnypadDev on topic Radee native lib crash on Document#getOutlineDest()
radaee wrote: sorry, i better checked old codes, and found utf16 has 512 buffer, utf8 has 512 buffer too, not 1024.
this behaviour in JNI wrap codes.
that mean, overflow happen when add utf8 at 511 position.
Thanks. can you give me an example of a problematic string? I tried an Outline title of 120k English characters but it didn't crash. Then I appended a CJK character at the end, it still didn't crash.
* Do you have a timeline for the next stable release?
* What workaround can you recommend to clients?
Thanks
Time to create page: 0.383 seconds