Bug 333636 - Conversion between unicode and windows code
Summary: Conversion between unicode and windows code
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: encoding (show other bugs)
Version: 3.13.0
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-19 22:53 UTC by Steve Kim
Modified: 2016-01-31 16:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-23155-0.html (4.23 KB, text/html)
2014-05-04 22:05 UTC, Steve Kim
Details
attachment-23155-1.dat (1 bytes, multipart/alternative)
2014-05-04 22:05 UTC, Steve Kim
Details
bug333636-utf8korean.txt (348 bytes, text/plain)
2014-05-04 22:05 UTC, Steve Kim
Details
bug333636-fig1.png (94.46 KB, image/png)
2014-05-04 22:05 UTC, Steve Kim
Details
bug333636-fig2.png (85.06 KB, image/png)
2014-05-04 22:05 UTC, Steve Kim
Details
Conversion Menu (81.66 KB, image/png)
2014-05-06 12:20 UTC, Dominik Haumann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Kim 2014-04-19 22:53:25 UTC
This is not a bug, but I would like have one more feature in Kate.
Various character encondings can be used in current version (3.10.0) of Kate.
But, I would like to convert text in unicode (I'm using UTF-8) and to text in another code (I'm interested in EUC-KR) and vice versa inside Kate.
I mean that Kate changes text data from UTF-8 to EUC-KR and vice versa while maintaining screen view.
There is this feature at Notepad++ which is a Windows app, and I miss the feature in Kate.
I recently switch to linux from Windows and Kate is the best text editor app in linux, but I miss the code conversion feature.
Thanks for reading.

Reproducible: Always

Steps to Reproduce:
1. Read Korean text file in UTF-8
2. Choose encoding (Korean->EUCKR)


I wish I have code conversion menu in addition to code change menu which exists now
Actual Results:  
The korean letters are broken on screen

Expected Results:  
The result is as expected. I wish I have additional menu for code conversion.
Comment 1 Christoph Feck 2014-05-04 18:31:23 UTC
I do not understand the steps. Is your file in UTF-8 encoding or in EUC-KR encoding?

If it is UTF-8, it should be loaded correctly (but you wrote "The korean letters are broken on screen"?), and you should be able to choose a different encoding when saving the file.
Comment 2 Steve Kim 2014-05-04 22:05:32 UTC
Created attachment 86460 [details]
attachment-23155-0.html

Dear Sir,

First of all, thank you very much for your attention to my bug (feature
improvement) report, and thanks for your e-mail.

I think that this is not a bug, but I think that this feature addition
improves experience of Kate to Korean users. (maybe Chinese and Japanese,
too)

I am using Kate 4.13.0 at Ubuntu 14.04 (with Korean language pack).

Please refer to attached file 'bug333636-utf8korean.txt'. This contains a
few English and Korean sentences in UTF-8 encoding. Please do the following
steps.

(1) Launch Kate.
(2) Open the text file (bug333636-utf8korean.txt).
(3) The text file is perfectly okay as shown in screen shot image file
(bug333636-fig1.png). This file is attached with this e-mail.
(4) Choose menu, Tools=>encoding=>Korean=>EUC-KR
      I have no idea of exact menu names because the menus appear in Korean
for me.
      But, the names should be similar to the above.
(5) The text file is shown as screen shot image file (bug333636-fig2.png),
     and Korean letters are broken. This file is also attached with this
e-mail.

As you can see, the korean texts are broken in step (5).
I understand that the menu should not be used to convert encodings, but
should be used to show current text codes by using the chosen encoding.
Therefore, it works as it should be, and this is not a bug.

Since I switch to Ubuntu from Windows a few weeks ago, I mention a Windows
application, "Notepad++"m which was my primary text editor in Windows. This
tool has 2 encoding menus. One is used to show current text codes by using
the chosen encoding, which is the same as "encoding" menu of Kate.

The other encoding menu is used to convert codes of texts on the fly.
Assume that I open a UTF-8 text file, and choose EUC-KR of this menu. Then
the text codes themselves are all changed from UTF-8 to EUC-KR, and shows
texts in EUC-KR. Therefore, the texts are not broken in this case.

I'm missing the feature at the above paragraph. Lack of this feature is not
critical in using Kate because I can save it as EUC-KR as you noted. But,
it  should create a file, and I have to save another file if I want to
convert back to UTF-8, which is a little bit awkward.

I believe that one more menu (or feature) to convert one encoding to
another makes Korean, Chinese and Japanese users happier.

Thanks for reading long e-mail.
Best regards,
Steve Kim




2014-05-05 3:31 GMT+09:00 Christoph Feck <christoph@maxiom.de>:

> https://bugs.kde.org/show_bug.cgi?id=333636
>
> Christoph Feck <christoph@maxiom.de> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>            Severity|major                       |wishlist
>
> --- Comment #1 from Christoph Feck <christoph@maxiom.de> ---
> I do not understand the steps. Is your file in UTF-8 encoding or in EUC-KR
> encoding?
>
> If it is UTF-8, it should be loaded correctly (but you wrote "The korean
> letters are broken on screen"?), and you should be able to choose a
> different
> encoding when saving the file.
>
> --
> You are receiving this mail because:
> You reported the bug.
>
Comment 3 Steve Kim 2014-05-04 22:05:35 UTC
Created attachment 86461 [details]
attachment-23155-1.dat
Comment 4 Steve Kim 2014-05-04 22:05:35 UTC
Created attachment 86462 [details]
bug333636-utf8korean.txt
Comment 5 Steve Kim 2014-05-04 22:05:35 UTC
Created attachment 86463 [details]
bug333636-fig1.png
Comment 6 Steve Kim 2014-05-04 22:05:35 UTC
Created attachment 86464 [details]
bug333636-fig2.png
Comment 7 Christoph Feck 2014-05-04 23:08:25 UTC
Kate internally uses only Unicode (UTF-16) encoding. Conversion happens on loading (by detecting the encoding of the file, which you can override via the menu), and saving (by letting the user change the encoding), so it makes no sense to internally convert the encoding as other text editors do (you would internally convert from UTF-16 to UTF-16).

> But, it should create a file, and I have to save another file if I want to convert back to UTF-8, which is a little bit awkward.

Here, I do not understand you, and I feel this is the actual issue you would like to see resolved. Could you clarify why specifying the encoding on save is not sufficient? You certainly can overwrite the same file with a different encoding, and can chose to save it as UTF-8 any time later, too.
Comment 8 Dominik Haumann 2014-05-06 12:20:55 UTC
Created attachment 86487 [details]
Conversion Menu

Steve, are you looking for a Encoding Conversion Menu? Like in Kile, see attached screenshot?

As Kevin said: Tools > Encoding is basically only used when loading a file. So converting the current text buffer to another encoding currently only works through "Save As...".
Comment 9 Christoph Cullmann 2016-01-31 16:22:07 UTC
We have now some explicit "Save with Encoding" menu in file. I think that should be enough for this not that common use case.