Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF

TOPIC:

Radee native lib crash on Document#getOutlineDest() 4 years 3 weeks ago #14952

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
each UTF16 convert to UTF8 has 4 possible:
1 UTF16 copy to 1 UTF8 char
1 UTF16 split to 2 UTF8 chars
1 UTF16 split to 3 UTF8 chars
2 UTF16 split to 4 UTF8 chars (UTF32 or UCS4 into 2 UTF16 chars, almost no happen)
all of these tested on the last beta version, also tested all conversion between them.
the last beta version allocate UTF8 string in dynamic buffer. so, last beta shall stable for your issue.
the last beta version also replace some invalid chars to blank chars, this can avoid exception when invalid UTF8 string pass to java.

i have no sample string to test with old version.
because allocate 512 bytes as UTF8 buffer, when write to 513 or 514 bytes, most times are not crashed.
this depends on what version of system or libc you are using, what devices you are using, and what APP memory status is this time.

i can only tell you: most CJK convert 1 UTF16 char to 3 UTF8 chars,
so you can make String with UTF8 length is 510 or 511, and then append one CJK char to this String.
you can using our last beta SDK to set meta, not old version(old version has limit size to set meta string), this method convert UTF8 string to UTF16 string, and then write UTF16 string into PDF file.

about when to publish stable release:
depends on some testing and other features, i don't know the plan.
The following user(s) said Thank You: AnypadDev

Please Log in or Create an account to join the conversation.

Last edit: by radaee.
Powered by Kunena Forum