make khtml/misc/decoder.* public

Anders Lund anders at alweb.dk
Mon Mar 5 09:53:44 GMT 2007


On Monday 05 March 2007, Stephan Kulow wrote:
> Am Sonntag 04 März 2007 schrieb Cyrille Berger:
> > > You may feel that doing so is better than not, because it means that
> > > the characters in the file will be correctly rendered. But when you
> > > edit and save the file, it means that you may make a change to the file
> > > that you do not know of.
> >
> > I think its worse to have : "I open a file, edit something but don't
> > realize yet that the file was opened with the wrong encoding, save,
> > close, and reopent the file later, scroll, and then realize that a large
> > part of the file is broken". And it has happen quiet often to me. And to
> > me, there is nothing worse than data loss.
>
> But still the decoder in khtml is only made for rendering (i.e. readonly).
> So if we want to use this for editors, we need a "safe for saving" flag. If
> you open iso-8859-15 without non-ASCII letters as ASCII, there won't be any
> harm done. But as soon as you skip letters or merge letters or whatever
> we're talking data loss. So the decoder as is should not be used for files
> that will be saved later.

I thought of something like that.

Another options would be to warn the user during loading if the selected 
encoding doesn't contain all the characters used.

-- 
Anders

www: http://www.alweb.dk
jabber: anderslund at jabber.dk




More information about the kde-core-devel mailing list