<p>It is not generally possible to always accurately determine the encoding of a file just from its content, and particularly if it is a small file with little content.  This is even more difficult for files encoded in various "code pages" since they resuse the same codes to mean different characters.</p>
<p>What encodings are specified by your locales on Windows and Linux?  My guess is that the Windows locales match the file encoding, but the Linux one is UTF-8.</p>
<p>Inside Geany all files are UTF-8 encoded, they are only converted on opening and closing, thats why changing the encoding specification does nothing.</p>
<p>On opening a file with no embedded encoding specification, and no explicitly set encoding, Geany will first check to see if the file is already UTF-8, then check the encoding specified by the locale, then get desperate and try the known encodings and accept the first that converts to a valid UTF-8.  At least that gets the file open and you can then often see that its wrong and close and re-open it with a different encoding (you did notice that the "more options" section of the open dialog allows you to select an encoding for this file).</p>

<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/1429#issuecomment-286647888">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ4m86iNw7b0bP4QdzJ6dn34eG6YQks5rl3zLgaJpZM4Mdfp6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJzcZW4UoH213pYmLdrQOxv7fH6bdks5rl3zLgaJpZM4Mdfp6.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/1429#issuecomment-286647888"></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":"@elextr in #1429: It is not generally possible to always accurately determine the encoding of a file just from its content, and particularly if it is a small file with little content.  This is even more difficult for files encoded in various \"code pages\" since they resuse the same codes to mean different characters.\r\n\r\nWhat encodings are specified by your locales on Windows and Linux?  My guess is that the Windows locales match the file encoding, but the Linux one is UTF-8.\r\n\r\nInside Geany all files are UTF-8 encoded, they are only converted on opening and closing, thats why changing the encoding specification does nothing. \r\n\r\nOn opening a file with no embedded encoding specification, and no explicitly set encoding, Geany will first check to see if the file is already UTF-8, then check the encoding specified by the locale, then get desperate and try the known encodings and accept the first that converts to a valid UTF-8.  At least that gets the file open and you can then often see that its wrong and close and re-open it with a different encoding (you did notice that the \"more options\" section of the open dialog allows you to select an encoding for this file)."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1429#issuecomment-286647888"}}}</script>