#14674: StyledEdit Misreads UTF-8 Files as Something Else
---------------------------------------+----------------------------
Reporter: AGMS | Owner: nobody
Type: bug | Status: new
Priority: normal | Milestone: Unscheduled
Component: Applications/StyledEdit | Version: R1/Development
Resolution: | Keywords: Encoding
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
---------------------------------------+----------------------------
Comment (by pulkomandy):
The encoding to use when saving a file can be selected in the save
filepanel. Likewise when opening a file. Which makes me wonder what's the
point of having an encoding menu in the main window in the first place.
To keep things manageable, the internal encoding should always be utf-8
(or some other unicode representation), encoding is a file io operation,
unless we want to restrict which characters can be entered to make sure a
file can be faithfully represented in a given encoding. Also, loading then
saving a file should of course preserve the existing encoding. I think
these are the reason why StyledEdit keeps an internal notion of encoding
even when not doing file IO.
I had a look through the sourcecode and I didn't find any place where we
make an attempt to guess the encoding. Either I missed it (this involves
BTextView, BTranslationUtils, and a bunch of other things), or it's
missing altogether and should be added. I'm not sure how we end up
deciding on ISO_8859, if in doubt, i'd say we should rather assume UTF-8
these days.
--
Ticket URL: <https://dev.haiku-os.org/ticket/14674#comment:3>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.