LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2015, 09:25 PM   #1
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 882

Rep: Reputation: 45
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
 
Old 02-18-2015, 02:33 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
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
Attached Thumbnails
Click image for larger version

Name:	README.html.png
Views:	11
Size:	136.1 KB
ID:	17606  
 
Old 02-18-2015, 06:25 AM   #3
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 882

Original Poster
Rep: Reputation: 45
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
Attached Thumbnails
Click image for larger version

Name:	snapshot2.png
Views:	13
Size:	62.5 KB
ID:	17607  

Last edited by rbees; 02-18-2015 at 06:30 AM.
 
Old 02-18-2015, 08:04 AM   #4
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 882

Original Poster
Rep: Reputation: 45
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.
 
Old 02-18-2015, 09:03 PM   #5
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 702

Rep: Reputation: 286Reputation: 286Reputation: 286
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.
 
Old 02-19-2015, 06:02 AM   #6
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 882

Original Poster
Rep: Reputation: 45
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't Drag&Drop 12345 Slackware 0 08-02-2008 12:02 PM
Handling File Drag & Drop in simple XLIB or OpenGL App (C++) fcdev Programming 1 07-05-2008 10:29 AM
KDE drag/drop from browser: Firefox vs. Konqueror mikanoid Linux - Software 1 12-22-2006 04:46 PM
Drag & Drop STARHARVEST Slackware 1 12-03-2006 01:35 AM
Drag & Drop into KView digitalhead Linux - Software 1 03-31-2005 10:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration