LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   konqueror drag & drop results in bad text file encoding (https://www.linuxquestions.org/questions/linux-newbie-8/konqueror-drag-and-drop-results-in-bad-text-file-encoding-4175534362/)

rbees 02-17-2015 08:25 PM

konqueror drag & drop results in bad text file encoding
 
Ladies & Gents

So in the process of coping some text out of html files in konqueror into kwrite I discovered that it will drag and drop the text after it is selected. The problem is that when I try to open the file saved in kwrite it is in a strange encoding that is not readable. There are a lot of these files that are now corrupt. Does anybody know how to re-encode the files so I don't have to regenerate them

Thanks

jdkaye 02-18-2015 01:33 AM

1 Attachment(s)
I'm having trouble understanding what you did. You write:
Quote:

I discovered that it will drag and drop the text after it is selected.
"drag and drop" into what??? Kwrite? When I drag and drop an .html file from Konqueror into kwrite it looks like the attached screenshot. I don't observe any problems involving encoding, do you? Please explain more precisely what exactly you did.
jdk

rbees 02-18-2015 05:25 AM

1 Attachment(s)
Thanks idkaye,

The html came as part of a zip file that when extracted can be opened in a web browser.

What I do is navigate to the particular section I want, highlight the wanted text, left mouse click-hold, cursor will then change, and drag to kwrite window and drop. (larger amounts of text will take longer for the cursor to change) It was quite by accident that I discovered that it will drag and drop that way.

The text looks normal until the file is saved and reopened. Then it has this strange encoding. So I opened it in Midnight Commander and the text has a " . " between the characters, .t.o. .l.o.o.k. .s.o.m.e.t.h.i.n.g. .l.i.k.e. .t.h.i.s.

When I highlight, choose copy then paste from a menu or with keyboard shortcuts it does not do this. There is no <html> in the copied text other than an the occasional {s} or a {p} which I then removed from the text file. I don't want the html only the text

Html sample code that generated the attached image
Code:

<A NAME="18"> </A>
<B>18</B> And of Zebulun he said: Rejoice, Zebulun, in thy going out, and, Issachar, in thy tents.
<A NAME="19"> </A>
<B>19</B> They shall call peoples unto the mountain; there shall they offer sacrifices of righteousness; for they shall suck the abundance of the seas, and the hidden treasures of the sand. <B>{S}</B>
<A NAME="20"> </A>
<B>20</B> And of Gad he said: Blessed be He that enlargeth Gad; he dwelleth as a lioness, and teareth the arm, yea, the crown of the head.
<A NAME="21"> </A>
<B>21</B> And he chose a first part for himself, for there a portion of a ruler was reserved; and there came the heads of the people, he executed the righteousness of the LORD, and His ordinances with Israel. <B>{S}</B>

I should note that when the paste is completed the text is formated the way it is displayed in the browser.

Thanks

rbees 02-18-2015 07:04 AM

One more thing. The files that are generated correctly open as they should. The ones that have this strange encoding do not, I have to tell it what program to open them with.

norobro 02-18-2015 08:03 PM

You might try changing the settings in KWrite: Settings->Configure Editor->Open/Save -change Encoding and Fallback Ecoding to UTF-16.

The version of Konquerer on my box won't allow me to drag text. If I highlight text and then click on it, the highlighing goes away.
Code:

$ konqueror -v                                                     
Qt: 4.8.6                                                                                         
KDE Development Platform: 4.14.2                                                                 
Konqueror: 4.14.2

As an aside, I have been following your other threads and I wondered if this command line app might be of use: Bible
It is based on the KJV of the Bible. I don't know the differences between the Hebrew Bible and the KJV but here's some output:
Code:

$ bible det33:18-19

Deuteronomy 33

  18 And of Zebulun he said, Rejoice, Zebulun, in thy going out; and, Issachar,
in thy tents.
  19 They shall call the people unto the mountain; there they shall offer
sacrifices of righteousness: for they shall suck of the abundance of the seas,
and of treasures hid in the sand.


rbees 02-19-2015 05:02 AM

Thanks norobro,

I don't know that it matters if kwrite can display the text correctly. In the larger project these files will be handed to a speech synthesizer like espeak or festival which must be able to decode it correctly. As I said before Midnight Commander the ncurses file manager shows the content and it is corrupt so I am guessing that the speech synthesizers will have the same problem. Those extra characters have to not be there.

It also makes it harder to update the archaic hundred year old english. I have not used the "bible" command line program but I am sure the kjv is just as archaic as the jps. I did look at debian's package page for it and it says that it could "in theory" use any bible, but there were no indications on how one would do that. Besides that is way beyond what I am capable of.

It is interesting that I have the same konqueror you do
Code:

:~$ konqueror -v
Qt: 4.8.6
KDE Development Platform: 4.14.2
Konqueror: 4.14.2

I looked through the menus for a place to enable drag&drop but didn't find it. My system is pure debian testing updated weekly with kde gui. There are a few gnome packages installed but not the whole environment.

My selected text does not disappear, the cursor goes from the "I" text cursor to an arrow to a "circle/w/line through it" while in the konqueror window, but when it moves outside it it then changes to a hand. I do have the touchpad buttons switched so that the left is on the right, not that I think that should matter.

Thanks again.


All times are GMT -5. The time now is 05:42 PM.