Bug 81918 - [workspace] site's "build all" seems not using project encoding
Summary: [workspace] site's "build all" seems not using project encoding
Status: RESOLVED DUPLICATE of bug 155015
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 92372 155931 232241 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-27 04:46 EST by neoedmund CLA
Modified: 2008-07-14 10:08 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description neoedmund CLA 2004-12-27 04:46:47 EST
site's "build all" seems not using project encoding, 
my plugin project is in UTF8 encoding, and can build successfully,
but fails when using site project's "build all", which give a error on where a 
unicode character appears.
Comment 1 Wassim Melhem CLA 2005-01-05 09:22:47 EST
when a build fails, there is typically a log in the site project.  Please 
attach it.

the plugin build process has nothing to do with project encoding.
Comment 2 neoedmund CLA 2005-01-05 19:58:57 EST
in the log file:
[code]ERROR in xxx.java (at line 35)
	special.add(new Character('�'));
	                          ^^^^
Invalid character constant[/code]
the project's encoding has been set to UTF8, and there are Chinese characters 
in java file. Maybe the site builder didn't use the project encoding and use 
the default encoding of platform.
Comment 3 Wassim Melhem CLA 2005-01-05 22:33:32 EST
Olivier,
given that PDE does not set/touch the encoding one way or another during the 
build, would you happen to have some insight into why the file compiles fine 
in one context (in the workspace) and not in another (via the Ant build 
script)?
Comment 4 neoedmund CLA 2005-01-06 00:16:20 EST
you know,
javac has an option -encoding, you should set it.
Comment 5 Wassim Melhem CLA 2005-01-06 22:40:50 EST
Moving back to pde/build as they generate the content of the build.xml, which 
currently does not include the 'encoding' attribute.

However, as long as pde/build is workspace-agnostic, I don't foresee an easy 
solution since each plugin project can have its own special encoding.  
Therefore, no one-size-fits-all encoding value that pde/ui can set on the ant 
launch config will be good enough.
Comment 6 Pascal Rapicault CLA 2005-01-06 23:39:58 EST
If I'm correct the compiler can't guess the encoding (Olivier?), and PDE build does not have the info 
since it is workspace unaware. Unless my first assertion is false, I can't see what we can do?
Comment 7 Olivier Thomann CLA 2005-01-07 10:18:48 EST
When PDE/UI generates the build script, could it retrieve the encoding of the
project?
If no encoding is specified, the compiler is using the platform encoding.
Comment 8 Pascal Rapicault CLA 2005-01-07 10:51:18 EST
Given that encodings can be specific to a project, a folder, or a file, there is
no solution that will cover 100% of the case.
Even if PDE UI was able to give us a list of encodings per folder in each
projects  , problems would still occur when building in a releng style mode.
Comment 9 neoedmund CLA 2005-01-09 21:46:53 EST
i think site build should just invoke the sub feature build, and feature build 
just invoke the sub plugin build when compiling the source. because each build 
work well in its own scope.
Comment 10 Pascal Rapicault CLA 2005-08-09 21:48:55 EDT
*** Bug 92372 has been marked as a duplicate of this bug. ***
Comment 11 Andrew Niefer CLA 2006-01-12 16:20:14 EST
pde.build will set the javac task's encoding according to the property javacDefaultEncoding.<libraryname> from the plugin's build.properties.
ex:  javacDefaultEncoding..=ISO-8859-1

It will also set per file & per folder encodings according to the javacCustomEncodings.<libraryname> property.
ex: javacCustomEncodings.library.jar=src1[US-ASCII],\
                                     src2/foo.java[Cp1252]

we would want pde.ui to write at least the default encoding property.  Getting the list of folders/files with custom encodings can be expensive without knowing the implementation of the preference store.
Comment 12 Andrew Niefer CLA 2006-09-01 16:41:47 EDT
*** Bug 155931 has been marked as a duplicate of this bug. ***
Comment 13 Benjamin Cabé CLA 2007-04-26 03:51:19 EDT
Hi all, 

Is there any plan to try to fix this bug or, at least, could someone please try to explain me the reason why PDE build can't retrieve encoding settings defined in .settings/org.eclipse.core.resources.prefs ?
I've tried to understand where the real problem stands reading this bug and its duplicates' comments but I'm not sure it's very clear to me ... :)
Comment 14 David Pérez CLA 2008-05-15 05:41:39 EDT
*** Bug 232241 has been marked as a duplicate of this bug. ***
Comment 15 Benjamin Cabé CLA 2008-05-15 09:00:25 EDT
Well, in fact, it's a dupe of bug 155015, because it's a problem much more general than just update sites.
Comment 16 Chris Aniszczyk CLA 2008-07-14 10:08:34 EDT

*** This bug has been marked as a duplicate of bug 155015 ***