Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Encoding issues
Encoding issues [message #26760] Fri, 27 June 2008 17:19 Go to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

I'm using DLTK on Windows, I have both Europa and Ganymede. I have the
following problem: My Ruby project files are all UTF-8, but when I run
them the output is misunderstood, maybe console tries to read it as
ISO-8859-1. I could at least try to change the console encoding for each
Run configuration but when I change from default to select one, then the
slection box keeps disabled as the run button too, so that I can't change
console encoding (I guess it's a bug).

Dealing with this issue lead me to discover what seems some bugs in DLTK,
they're three problems:

1) On Window > Preferences > General > Content Types: Ruby source file is
set as UTF-8 by default, but when you erase this value, click update and
close window, then when you come back again UTF-8 appears again. This
doesn't happen with other content types.

2) When you change file encoding in the properties of a Ruby project or
sub-folder, the encoding is not applied. This works well and on-the-fly
with Java projects for example: if you type some "ã" on a UTF-8 file and
change project encoding to ISO-8859-1, that "ã" changes into messy chars.
Remember that this setting doesn't change files encoding, but only their
view (how the file will be interpreted).

3) Mainly, Java project wether are UTF-8 or ISO-8859-1, for example,
automatically gives us output according to the project encoding, but Ruby
project doesn't. For example, my UTF-8 project has its console's output as
ISO-8859-1 (puts "ã"-like stuff changes into a character mess).

As a workaround I'll have to change EACH of my files to ISO-8859-1 (I use
notepad++ for that). Please, correct these bugs!!!

Thanks!!!
Re: Encoding issues [message #26807 is a reply to message #26760] Sun, 29 June 2008 02:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

Actually thinking more about that, I guess the Run Dialog's bug may be
related to the other ones.

Ruby's Run Dialog doesn't work. When you open that dialog through Java
perspective, it works fine but if you click on a Ruby's run configuration,
the the whole dialog crashes (Run button never enables and other weird
behavior). This happens on Eclipse Europa, on Ganymede it's crashed
regardless of DLTK: when you open run dialog you get an error message.

Thanks for the attention.
Re: Encoding issues [message #26928 is a reply to message #26760] Mon, 30 June 2008 10:16 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Renato,

Renato Silva wrote:
> I'm using DLTK on Windows, I have both Europa and Ganymede. I have the
> following problem: My Ruby project files are all UTF-8, but when I run
> them the output is misunderstood, maybe console tries to read it as
> ISO-8859-1.

Thanks for you message I have found a difference in how Run & Debug
configurations detect default encoding.

Since 3.4 (Ganymede) the default encoding is inherited from the resource
(project) associated with the launch configuration. If encoding is not
specified for the project - encoding configured for the workspace or
system default encoding is used.

So for the Run configurations you should specify encoding for the
project - and it should work ok.

In the debug mode only encoding specified in the launch configuration
was checked - I have fixed that in CVS the fix will be included in
0.95.1 and 1.0M1 releases.

> I could at least try to change the console encoding for each
> Run configuration but when I change from default to select one, then the
> slection box keeps disabled as the run button too, so that I can't
> change console encoding (I guess it's a bug).

I can't reproduce this issue. Have you tried it on other computers? What
OS do you using? Have you tried to reproduce it on the fresh Eclipse
DLTK install and new workspace?

> Dealing with this issue lead me to discover what seems some bugs in
> DLTK, they're three problems:
>
> 1) On Window > Preferences > General > Content Types: Ruby source file
> is set as UTF-8 by default, but when you erase this value, click update
> and close window, then when you come back again UTF-8 appears again.
> This doesn't happen with other content types.

It happens for content types where default encoding is specified while
registering data types. At the moment ruby is registered with UTF-8 as
the default content type, so it is eclipse who is replacing empty value
with the default encoding. For example "java properties file" have
default encoding iso-8859-1 and if I replace it with empty value - it
reappears.

> 2) When you change file encoding in the properties of a Ruby project or
> sub-folder, the encoding is not applied. This works well and on-the-fly
> with Java projects for example: if you type some "ã" on a UTF-8 file and
> change project encoding to ISO-8859-1, that "ã" changes into messy
> chars. Remember that this setting doesn't change files encoding, but
> only their view (how the file will be interpreted).

I can't reproduce this issue.

> 3) Mainly, Java project wether are UTF-8 or ISO-8859-1, for example,
> automatically gives us output according to the project encoding, but
> Ruby project doesn't. For example, my UTF-8 project has its console's
> output as ISO-8859-1 (puts "ã"-like stuff changes into a character mess).
>
> As a workaround I'll have to change EACH of my files to ISO-8859-1 (I
> use notepad++ for that). Please, correct these bugs!!!
>
> Thanks!!!
>

Regards,
Alex
Re: Encoding issues [message #27008 is a reply to message #26928] Mon, 30 June 2008 23:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

Hi Alex,

> Since 3.4 (Ganymede) the default encoding is inherited from the resource
> (project) associated with the launch configuration. If encoding is not
> specified for the project - encoding configured for the workspace or
> system default encoding is used.

> So for the Run configurations you should specify encoding for the
> project - and it should work ok.

It's important to notice that the first setting to verify however is the
encoding of the file itself, prior to project encoding, because you could
need to have a project with files on multiple encodings. In fact it's
possible to do, you just have to set encodings at file level instead of
project or workbench level.

But regardless of this, the problem remains. I set project's encoding
manually to UTF-8, and even files being really UTF-8, their outputs
aren't. I've noticed that the Run configuration is generated with
ISO-8859-1, even if the project is manually set to UTF-8.

I've got to change console's output for the Run configuration on an Europa
on another machine. But still, you need to do this manually instead of the
software getting it from file/project/workbench.

Maybe you're not reproducing this problem because your workspace is set to
UTF-8, but I'm on Windows which doesn't use UTF-8 by default, but Cp 1252
(I guess this maps to ISO-8859-1). Therefore your output woudn't change
encoding.



> I can't reproduce this issue.

I also couldn't do it on another machine. I'm gonna try to reinstall DLTK
again at home and see how it goes :)



>> 3) Mainly, Java project wether are UTF-8 or ISO-8859-1, for example,
>> automatically gives us output according to the project encoding, but
>> Ruby project doesn't. For example, my UTF-8 project has its console's
>> output as ISO-8859-1 (puts "ã"-like stuff changes into a character mess).
>>
>> As a workaround I'll have to change EACH of my files to ISO-8859-1 (I
>> use notepad++ for that). Please, correct these bugs!!!

As I mentioned above, this is the remaining problem that persists even on
a clean install on another machine. On this another machine at least I can
change encoding for the specific run configuration, but we shoudn't need
to do this.

I'm using Windows XP Pro. Regards.
Re: Encoding issues [message #27047 is a reply to message #27008] Tue, 01 July 2008 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

I'm at home and did the following on Europa: removed all dltk files from
Eclipse's directory and also deleted my whole workspace metadata. I've
downloaded DLTK full 0.95 and therefore installed it again from scratch.
But it still has problems. I'd like to update my problems list to the
following to be more clear:


1) Default workspace encoding is Cp1252 (~= ISO-8859-1), and thus my Ruby
project, but the files themselves are mostly UTF-8. If the project was a
Java project, only Cp1252 files would be well visualized and we'd see
UTF-8 files with conflicting chars (ã, ê, í, etc)as messy files.

But even if no project encoding is set and workspace encoding is Cp1252,
DLTK treats all files as UTF-8!!! Therefore, ISO-8859-1 files is what will
be messy instead, when actually it should be UTF-8 ones! This looks weird
but is exactly what's happening. Read again if necessary to understand
well.


2) Run dialog isn't working still, the same way I mentioned before. But
I've noticed an error back to the dialog, pointing to some log. I've found
that log and here is some stacktrace: http://pastebin.com/m9ba92c1. Take a
look at line 90, that is one of my files. Analyzing how the referred index
varies from file to file, I've just discovered that you can't have spaces
at the path of your project!!!


In a nutshell: all this evidences make me guess that the following
problems are happening and need to be fixed:


Problem #1
==========
DLTK is always treating files as UTF-8 regardless of project or workspace
configuration. Only file-level configuration works.

For example if you put an ISO-8859-1 file on an ISO-8859-1 project, then
special chars become messy, but if you put UTF-8 files on the same project
then they're shown ok. Actually, the expected behavior is the contrary.

Notice that output is misunderstood (my original problem) because it's
being treating as ISO-8859-1 (inherited from my workspace config).

I wonder whether the second problem bellow is someway related to this one
(maybe DLTK would be trying to get encoding configuration to know how to
treat files but can't because of spaces in path, then it treats all files
as UTF-8, as a default behavior).


Problem #2
==========
DLTK is not allowing to store your project into a directory containing
spaces. This is what's making Run dialog to crash!

I ask your attention to my message and appreciate your help, regards.
Re: Encoding issues [message #27087 is a reply to message #27047] Tue, 01 July 2008 04:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

A correction: the space error is regarding spaces on the path of the file
being ran, not exclusively on the project's path itself.

* My project's path is like C:\Programming\Ruby.

* This is a file with no spaces into a sub-folder with spaces:
C:\Programming\Ruby\Studying Ruby\File.rb ---> crashes Run dialog

* This is a file with spaces right on the project's root:
C:\Programming\Ruby\Spaced File.rb ---> crashes Run dialog too

* This is a file with spaces right on the project's root:
C:\Programming\Ruby\NoSpacesPath.rb ---> this works!
Re: Encoding issues [message #27125 is a reply to message #27087] Tue, 01 July 2008 05:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

Sorry this site crashes all pretty formatting I make to my posts!
Re: Encoding issues [message #27164 is a reply to message #27087] Tue, 01 July 2008 05:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

> * This is a file with spaces right on the project's root:
> C:ProgrammingRubyNoSpacesPath.rb ---> this works!

I mean a file WITHOUT spaces.

Oh, we could be able to edit messages! What about a forum like PhpBB or so
:)
Re: Encoding issues [message #27203 is a reply to message #27047] Tue, 01 July 2008 06:44 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Renato,

Thanks for reporting these bugs.
We have just fixed the Run dialog crashes on spaces in CVS and will be
working on the encoding fixes in the nearest days.

The bugs are registered in bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=239082
https://bugs.eclipse.org/bugs/show_bug.cgi?id=238945

You can add yourself to the CC list to get notified when they are fixed.

Regards,
Alex


Renato Silva wrote:
> I'm at home and did the following on Europa: removed all dltk files from
> Eclipse's directory and also deleted my whole workspace metadata. I've
> downloaded DLTK full 0.95 and therefore installed it again from scratch.
> But it still has problems. I'd like to update my problems list to the
> following to be more clear:
>
>
> 1) Default workspace encoding is Cp1252 (~= ISO-8859-1), and thus my
> Ruby project, but the files themselves are mostly UTF-8. If the project
> was a Java project, only Cp1252 files would be well visualized and we'd
> see UTF-8 files with conflicting chars (ã, ê, í, etc)as messy files.
> But even if no project encoding is set and workspace encoding is Cp1252,
> DLTK treats all files as UTF-8!!! Therefore, ISO-8859-1 files is what
> will be messy instead, when actually it should be UTF-8 ones! This looks
> weird but is exactly what's happening. Read again if necessary to
> understand well.
>
>
> 2) Run dialog isn't working still, the same way I mentioned before. But
> I've noticed an error back to the dialog, pointing to some log. I've
> found that log and here is some stacktrace:
> http://pastebin.com/m9ba92c1. Take a look at line 90, that is one of my
> files. Analyzing how the referred index varies from file to file, I've
> just discovered that you can't have spaces at the path of your project!!!
>
> In a nutshell: all this evidences make me guess that the following
> problems are happening and need to be fixed:
>
>
> Problem #1
> ==========
> DLTK is always treating files as UTF-8 regardless of project or
> workspace configuration. Only file-level configuration works.
> For example if you put an ISO-8859-1 file on an ISO-8859-1 project, then
> special chars become messy, but if you put UTF-8 files on the same
> project then they're shown ok. Actually, the expected behavior is the
> contrary.
>
> Notice that output is misunderstood (my original problem) because it's
> being treating as ISO-8859-1 (inherited from my workspace config).
>
> I wonder whether the second problem bellow is someway related to this
> one (maybe DLTK would be trying to get encoding configuration to know
> how to treat files but can't because of spaces in path, then it treats
> all files as UTF-8, as a default behavior).
>
>
> Problem #2
> ==========
> DLTK is not allowing to store your project into a directory containing
> spaces. This is what's making Run dialog to crash!
> I ask your attention to my message and appreciate your help, regards.
>
Re: Encoding issues [message #27277 is a reply to message #27203] Tue, 01 July 2008 18:05 Go to previous message
Eclipse UserFriend
Originally posted by: renato3110.yahoo.com.br

Thank you very much, Alex!
Previous Topic:Regarding DLTK IDE Guide
Next Topic:Tcl/Tk Debug_tool not working well in eclipse
Goto Forum:
  


Current Time: Sat Jul 27 11:24:49 GMT 2024

Powered by FUDForum. Page generated in 0.03622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top