tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

Save in latin-1 or another encoding #134

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

If a text can be saved in latin-1, I'd like to be able to do so. I can convert it with external tools, but it's not convenient.

I think this could be presented as a simple drop-down "desired encoding" menu, which would propose: default/utf8, latin1, ascii, ...

Once the encoding is chosen (with utf8 as default), ppqt should always try to save in this encoding if possible. I saving in the chosen encoding is not possible, then save in utf8, but with a warning window.

Currently it is possible to convert a text, and edit the meta file to change the encoding, and ppqt will hapilly load the text, but it will save in utf-8.

tallforasmurf commented 11 years ago

Currently the encoding is chosen when you open the document. You have the ability to open with a specific encoding (File > Open With Encoding...), or you can dictate encoding at open time with a file name (name-ltn.txt) or a file suffix (name.ltn). And you can save-as a specific encoding by changing the file name or suffix.

So what am I missing here? Why can't you Open As Encoding Latin1, after which Save should use that encoding? Or, if it opened as something else like the default UTF-8, you could save-as and put LTN in the filename.

bibimbop commented 11 years ago

That looks convoluted. When I first load the file from DP, it is converted into utf8. I then use utf8 characters inside (greek, œ, ...). I do as much processing at that stage. Then I fork the text. Now I want the text version to be latin-1, so I clean it, revert back some changes (greek is translitered only, œ->oe, ...). But it's still utf8 with latin-1 characters only. I see now that I can use the extension trick. Not ideal because it's one more file to care about, but I can live with that.