File encoding other than windows-1252

412 views
Skip to first unread message

noncom

unread,
Jul 20, 2012, 9:46:46 AM7/20/12
to scala-i...@googlegroups.com
I am trying to work with cyrillic text in Scala-IDE. Particulary, I have some strings that are in cyrillic. However, I keep getting errors like

IO error while decoding D:\work\workspaces\indigo_one\W-A_010__Isborsk\src\org\isborsk\main\MainIsborsk.scala with windows-1252 Please try specifying another one using the -encoding option

Which I do not know what to do with. I have been trying to change all the possible combinations of options everywhere in Eclipse and Scala-IDE. The source files are UTF-8. I am totally lost now.. Anyone has any idea? Or what is the mysterious '"-encoding" options and where should I set it?

noncom

unread,
Jul 20, 2012, 9:48:07 AM7/20/12
to scala-i...@googlegroups.com
And i just wanted to add that If I remove the cyrillic strings, then all is fine.

пятница, 20 июля 2012 г., 17:46:46 UTC+4 пользователь noncom написал:

iulian dragos

unread,
Jul 20, 2012, 9:49:49 AM7/20/12
to scala-i...@googlegroups.com
What is the workspace encoding? You can specify a default encoding for all your workspace in Eclipse Preferences, General/Workspace/Text Encoding.
 



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

noncom

unread,
Jul 20, 2012, 10:03:27 AM7/20/12
to scala-i...@googlegroups.com
My current settings are all UTF-8:
 - workspace encoding is UTF-8
 - run configuration is the default inherited (UTF-8)
 - Eclipse ini file is configured with encoding parameter "-Dfile.encoding=UTF-8"
 - Scala compiler encoding is set through the additional command-line parameter "-Dfile.encoding=UTF-8" (for some reason, the Scala compiler does not automatically conform to the Eclipse encoding specified in eclipse.ini
 - the source file encoding is "UTF-8 without BOM" as indicated by Notepad++.

so I am really confused...

пятница, 20 июля 2012 г., 17:49:49 UTC+4 пользователь Iulian Dragos написал:

noncom

unread,
Jul 20, 2012, 10:15:10 AM7/20/12
to scala-i...@googlegroups.com
Finally I got rid of it. I have changed the encoding of the single source file that contains the string to windows-1251 and it worked without any problems. Argh, these encodings always give me a headache. You never know what is happening (( spent so much time with the UTF-8 thing....

пятница, 20 июля 2012 г., 18:03:27 UTC+4 пользователь noncom написал:

iulian dragos

unread,
Jul 20, 2012, 11:29:05 AM7/20/12
to scala-i...@googlegroups.com
On Fri, Jul 20, 2012 at 4:03 PM, noncom <alex.m...@gmail.com> wrote:
My current settings are all UTF-8:
 - workspace encoding is UTF-8
 - run configuration is the default inherited (UTF-8)
 - Eclipse ini file is configured with encoding parameter "-Dfile.encoding=UTF-8"
 - Scala compiler encoding is set through the additional command-line parameter "-Dfile.encoding=UTF-8" (for some reason, the Scala compiler does not automatically conform to the Eclipse encoding specified in eclipse.ini

I don't know about that one, the Scala compiler uses the encoding defined for each resource (which most of the times is the workspace default).

Glad to hear you solved it.

iulian
 
 - the source file encoding is "UTF-8 without BOM" as indicated by Notepad++.

so I am really confused...

пятница, 20 июля 2012 г., 17:49:49 UTC+4 пользователь Iulian Dragos написал:

What is the workspace encoding? You can specify a default encoding for all your workspace in Eclipse Preferences, General/Workspace/Text Encoding.

--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

James Moore

unread,
Jul 20, 2012, 12:32:34 PM7/20/12
to scala-i...@googlegroups.com
On Fri, Jul 20, 2012 at 7:15 AM, noncom <alex.m...@gmail.com> wrote:
> Finally I got rid of it. I have changed the encoding of the single source
> file that contains the string to windows-1251 and it worked without any
> problems. Argh, these encodings always give me a headache. You never know
> what is happening (( spent so much time with the UTF-8 thing....

To make you even more confused, this works just fine for me on a Mac
with Eclipse Indigo and this morning's Scala IDE 2.10 nightly:

package com.restphone

object FileExperiment extends App {
var пятница = "Friday"
println(пятница)
}

I don't have to change anything at all, it just worked. I do use the
scalaz Unicode operators (or at least I read source files that do), so
a while ago I set this:

Preferences > General > Workspace > Text file encoding

to UTF-8.

--
James Moore
ja...@restphone.com
http://blog.restphone.com/
http://www.linkedin.com/in/jamesmmooreiv

noncom

unread,
Jul 23, 2012, 6:07:28 AM7/23/12
to scala-i...@googlegroups.com
%))) All these settings - I know.. I have changed them and watched.. moslty getting problems.. The encodings.. I will definitely have to iron all this stuff out some day.

пятница, 20 июля 2012 г., 20:32:34 UTC+4 пользователь James Moore написал:
Reply all
Reply to author
Forward
0 new messages