issue-#44 unicode content of links&targets saving wrong way

Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

issue-#44 unicode content of links&targets saving wrong way

Post by Ivan Denisov »

http://redmine.blackboxframework.org/issues/44

If the links & targets contain unicode content (tested for Cyrillic) it is damaging during Exteralize/Internalize.

Code: Select all

the link before save
<проверка>some link<>

the link after save, open and expanding
<?@>25@:0>some link<>
This bug is still persisting in CPC 1.7-RC6 also.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#44 unicode content of links&targets saving wrong

Post by Ivan Denisov »

I aggregated the experience from OberonCore:B2 fix and CPC version, so Cyrillic saving and restoring well.
http://redmine.blackboxframework.org/pr ... 4b15c28ec5
This is demo: blackbox-1.7-a1.124.zip
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#44 unicode content of links&targets saving wrong

Post by Ivan Denisov »

Few words about versions:

0 - default behaviour: close window if shift is down, never close if link contains ShowTarget (not storing v.close);
1 - unusual behaviour: always close window or never close (storing v.close state);
2 - always storing v.close state and storing v.cmd as widechars;

So detection of 2 should go first, not after 0 like in CPC version.

Code: Select all

IF HasWideChars THEN
 version := 2
ELSE default behaviour THEN
 version := 0
ELSE
 version := 1
END;
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#44 unicode content of links&targets saving wrong

Post by Zinn »

When detection of 2 should go first, why you don't simplify to

Code: Select all

IF HasWideChars THEN
 version := 2
ELSE
 version := 1
END;
or just to

Code: Select all

 version := 2
?
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#44 unicode content of links&targets saving wrong

Post by Ivan Denisov »

Zinn wrote:When detection of 2 should go first, why you don't simplify to ... ?
It will break some back compatibility for regular ASCII links.

Added later:
I mean that in this case if you prepare some document with our Center BB, it will not open in old versions. However with such versions keeping strategy if your link does not contain wide chars, it will be compatible with old versions.
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#44 unicode content of links&targets saving wrong

Post by Zinn »

My first succesion is backward compatible. We needn't add 0 again.

Further there was already a discussion about the backward compatibility.
It's result was we don't need them. (See StdStamps)
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#44 unicode content of links&targets saving wrong

Post by Ivan Denisov »

User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#44 unicode content of links&targets saving wrong

Post by Josef Templ »

There is no reason for giving up backward compatibility here.
Saving a few lines is not worh introducing an unnecessary
incompatibility with the document format.
This would really be a great mistake.

- Josef
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#44 unicode content of links&targets saving wrong

Post by Ivan Denisov »

Josef Templ wrote:There is no reason for giving up backward compatibility here.
Saving a few lines is not worh introducing an unnecessary
incompatibility with the document format.
This would really be a great mistake.
Josef, do I understand right, that you want to keep 0 version?

It can be replaced to 1 in 1.5 and 1.6. So theoretically it can break compatibility only for very old versions of BB.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#44 unicode content of links&targets saving wrong

Post by Josef Templ »

I did not have the time to look into the details of the implementation yet,
so I really don't know what version 0 or 1 or 2 means. Anyway, I am surprised
that this issue has not been fixed in CPC 1.7.

- Josef
Post Reply