On Mon, Sep 19, 2016 at 03:11:22AM -0700, Colomban Wendling wrote:<br>
> All I can imagine is that the file is broken, and the other editors<br>
> you try either truncate it, or are more forgiving and leaving the<br>
> invalid bytes as-is.<br>
<br>
To be fair, the only program I've used to edit this file (from memory)<br>
is MS Word. But it is interesting as you point out. Perhaps there was an<br>
edit some years ago in an editor which did not have encoding awareness.<br>
<br>
> As @elextr explained, we can't really do that<br>
> because we need UTF-8 encoding in the buffer, so need be able to<br>
> convert to and from it.  With invalid sequences, it wouldn't be<br>
> possible to restore it.<br>
<br>
Very sensible.<br>
<br>
Perhaps an editing mode that somehow shows all invalid sequences,<br>
in-situ, and making it clear to the user that the file may already be<br>
corrupted or something, and therefore allowing the user to try to fix<br>
the file. As it is, I'll go to either MS Word on Windows, or Vim on<br>
Linux.<br>
<br>
> I'm actually fairly curious as to what the editors you see it working<br>
> with actually do with those byte, and if they really don't break the<br>
> file.<br>
<br>
Only opened it. Checking now...<br>
<br>
OK:<br>
<br>
- Notepad++ shows the invalid sequences as black rectangles with<br>
  numbers, but stops at one line after "Wolian" and does not allow me to<br>
  copy that last line.<br>
<br>
- MSO Word has a dozen or so extra entries after that line "Wolian", and<br>
  seems to somehow display most entries correctly, except for the very<br>
  last entry.<br>
<br>
- Akelpad also stops at the infamous "Ŵolian" line<br>
<br>
- Microsoft Wordpad also stops at "wolian" line<br>
<br>
<br>
So it seems that either:<br>
- the encoding of this file is something other than the<br>
  proclaimed UTF-16LE<br>
<br>
- or the file is simply corrupted and Word does a better job<br>
  of displaying the errors<br>
<br>
- or what is proclaimed as UTF-16LE is a bastardized version of<br>
  UTF-16LE,<br>
  - or some other Word-specific encoding pretending to be UTF-16LE<br>
<br>
I don't really know what to do now, except to purge all the<br>
"interesting" entries, and go from there. And that will be adequate...<br>
<br>
<br>
> Also, there are fairly odd things even in the part fully valid UTF-16.<br>
> Is the file really supposed to contain things like `B風e-de-mer` on<br>
> line 194, `C岡r` on line 326`, `d诡rtement` on line 453, or `Ŵolian`<br>
> on line 1737 (penultimate line, and the last before the invalid<br>
> sequence)?<br>
<br>
I'm going to assume corruption.<br>
<br>
Thank you for your patience and interest.<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1238#issuecomment-247962453">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ6T3UYBS-TPCfV3WAaATsnrixt9Tks5qrmi-gaJpZM4KAGgV">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJw8Oybzn7n0pcTdAAYz55zmtVLU7ks5qrmi-gaJpZM4KAGgV.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1238#issuecomment-247962453"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@zenaan in #1238: On Mon, Sep 19, 2016 at 03:11:22AM -0700, Colomban Wendling wrote:\n\u003e All I can imagine is that the file is broken, and the other editors\n\u003e you try either truncate it, or are more forgiving and leaving the\n\u003e invalid bytes as-is.\n\nTo be fair, the only program I've used to edit this file (from memory)\nis MS Word. But it is interesting as you point out. Perhaps there was an\nedit some years ago in an editor which did not have encoding awareness.\n\n\u003e As @elextr explained, we can't really do that\n\u003e because we need UTF-8 encoding in the buffer, so need be able to\n\u003e convert to and from it.  With invalid sequences, it wouldn't be\n\u003e possible to restore it.\n\nVery sensible.\n\nPerhaps an editing mode that somehow shows all invalid sequences,\nin-situ, and making it clear to the user that the file may already be\ncorrupted or something, and therefore allowing the user to try to fix\nthe file. As it is, I'll go to either MS Word on Windows, or Vim on\nLinux.\n\n\u003e I'm actually fairly curious as to what the editors you see it working\n\u003e with actually do with those byte, and if they really don't break the\n\u003e file.\n\nOnly opened it. Checking now...\n\nOK:\n\n- Notepad++ shows the invalid sequences as black rectangles with\n  numbers, but stops at one line after \"Wolian\" and does not allow me to\n  copy that last line.\n\n- MSO Word has a dozen or so extra entries after that line \"Wolian\", and\n  seems to somehow display most entries correctly, except for the very\n  last entry.\n\n- Akelpad also stops at the infamous \"Ŵolian\" line\n\n- Microsoft Wordpad also stops at \"wolian\" line\n\n\nSo it seems that either:\n- the encoding of this file is something other than the\n  proclaimed UTF-16LE\n\n- or the file is simply corrupted and Word does a better job\n  of displaying the errors\n\n- or what is proclaimed as UTF-16LE is a bastardized version of\n  UTF-16LE,\n  - or some other Word-specific encoding pretending to be UTF-16LE\n\nI don't really know what to do now, except to purge all the\n\"interesting\" entries, and go from there. And that will be adequate...\n\n\n\u003e Also, there are fairly odd things even in the part fully valid UTF-16.\n\u003e Is the file really supposed to contain things like `B風e-de-mer` on\n\u003e line 194, `C岡r` on line 326`, `d诡rtement` on line 453, or `Ŵolian`\n\u003e on line 1737 (penultimate line, and the last before the invalid\n\u003e sequence)?\n\nI'm going to assume corruption.\n\nThank you for your patience and interest.\n"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1238#issuecomment-247962453"}}}</script>