Bug 54353 - Quanta saves ° instead of
Summary: Quanta saves ° instead of
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-09 17:08 UTC by Hendrik Richter
Modified: 2003-03-06 11:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik Richter 2003-02-09 17:08:33 UTC
Version:           Unbekannt (using KDE 3.1.0)
Installed from:    Gentoo
Compiler:          gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)
OS:          Linux (i686) release 2.4.19-gentoo-r10

When I edit a file from my project-list in quanta which contains a 
Comment 1 Thiago Macieira 2003-02-10 15:01:16 UTC
That's an encoding problem. Apparently, Quanta saves project files in UTF-8, but 
doesn't seem to do so for non-project files. 
 
Check if you are not making encoding problems. 
Comment 2 András Manţia 2003-02-10 15:43:16 UTC
Subject: Re:  Quanta saves =?iso-8859-1?q?=C2=B0=20instead=20of?= =?iso-8859-1?q?=20=B0?=

> ------- Additional Comments From thiagom@mail.com  2003-02-10 15:01 -------
> That's an encoding problem. Apparently, Quanta saves project files in
> UTF-8, but doesn't seem to do so for non-project files.
>
> Check if you are not making encoding problems.

It is possible to set the encoding for files in lot of places:

1. In Settings->Configure Quanta->Environment : the default for every file not 
belonging to a project
2. In the Project Options for project files
3. In the save/save as dialog if you want to select a specific encoding for a 
single file.

And yes, it looks like an encoding problem.

Andras

Comment 3 András Manţia 2003-02-10 16:22:51 UTC
Subject: QUANTA_3_1_BRANCH: quanta

CVS commit by amantia: 

Use the encoding from the options also for new files.

CCMAIL: 54353@bugs.kde.org


  M +1 -0      ChangeLog   1.90.2.26
  M +1 -1      quanta/quanta.cpp   1.188.2.10
  M +7 -0      quanta/quantadoc.cpp   1.79.2.2


--- quanta/ChangeLog  #1.90.2.25:1.90.2.26
@@ -16,4 +16,5 @@
     - fix renaming of file in the Project Tree, when a file with the new name was
       already present in the project
+    - use the correct encoding for newly created files
   - usability enhanchements:
     - show the tag attributes (Alt-Down) menu lower than the current line

--- quanta/quanta/quanta.cpp  #1.188.2.9:1.188.2.10
@@ -146,5 +146,5 @@ void QuantaApp::slotFileNew()
 void QuantaApp::slotFileOpen()
 {
- QString myEncoding = QString::fromLatin1(QTextCodec::codecForName(defaultEncoding().latin1())->name());
+ QString myEncoding = defaultEncoding();
 
  KateFileDialog *dialog = new KateFileDialog (QString::null,myEncoding, this, i18n ("Open File"));

--- quanta/quanta/quantadoc.cpp  #1.79.2.1:1.79.2.2
@@ -433,4 +433,11 @@ Document* QuantaDoc::newWrite()
   Document *w = new Document(quantaApp->projectBaseURL(), doc, quantaApp->getProject(),
                              quantaApp->m_pluginInterface, quantaApp->view->writeTab);
+  QString encoding = quantaApp->defaultEncoding();
+#if KDE_VERSION >= 308
+  dynamic_cast<KTextEditor::EncodingInterface*>(doc)->setEncoding(encoding);
+#else
+  w->kate_doc->setEncoding(encoding);
+#endif
+
   KTextEditor::View * v = w->view();
 


Comment 4 András Manţia 2003-02-10 16:23:19 UTC
Subject: Re:  New: Quanta saves =?iso-8859-1?q?=C2=B0=20instead=20of?= =?iso-8859-1?q?=20=B0?=

I've committed a fix to use the default (project or global) encoding also for 
new files. It should bring you the correct encoding in the Save As dialog. If 
you still see the problem, even if you use e.g utf8/utf16 or the encoding for 
your language on open/save, please send me a test file. But be careful, that 
you must use the same encoding when you open the file as it was used when 
you've saved the file. This statement is valid both for Quanta and Kate! 
And Quanta will always offer the same encoding on saving as the one was used 
while opening the file. Of course you can select another encoding in the Save 
As dialog.

Andras


Comment 5 András Manţia 2003-03-06 11:46:40 UTC
Subject: Re: Quanta saves =?iso-8859-1?q?=B0=20instead?= of

As I got no reply, I assume that the encoding problem is solved.