Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportPluginXMLFromOneFile.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportPluginXMLFromOneFile.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportPluginXMLFromOneFile.java	(revision 3905)
@@ -35,7 +35,7 @@
 			
 			File mergedPropertiesFile = new File(wmm.getWorkspaceLocation(), "org.txm.translate.rcp/bundle" + lang + ".properties");
 			Properties mergedProperties = new Properties();
-			mergedProperties.load(IOUtils.getReader(mergedPropertiesFile));
+			mergedProperties.load(IOUtils.getReader(mergedPropertiesFile, "iso-8859-1"));
 			
 			if (mergedProperties.size() == 0) {
 				System.out.println(" No messages to update");
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/CreateMessagesTable.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/CreateMessagesTable.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/CreateMessagesTable.java	(revision 3905)
@@ -35,10 +35,14 @@
 		
 		System.out.println("Building table...");
 		Properties master = new Properties();
-		master.load(IOUtils.getReader(defaultPropertiesFile, "UTF-8"));
+		String encoding = "UTF-8";
+		if (prefix.startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		master.load(IOUtils.getReader(defaultPropertiesFile, encoding));
 		
 		Properties slave = new Properties();
-		slave.load(IOUtils.getReader(langPropertiesFile, "UTF-8"));
+		slave.load(IOUtils.getReader(langPropertiesFile, encoding));
 		
 		OdfTextDocument doc = OdfTextDocument.newTextDocument();
 		
@@ -79,12 +83,17 @@
 		
 		File langPropertiesFile = new File(dir, prefix+"_"+lang+".properties");
 		
+		String encoding = "UTF-8";
+		if (prefix.startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
 		System.out.println("Building table...");
 		Properties master = new Properties();
-		master.load(IOUtils.getReader(defaultPropertiesFile, "UTF-8"));
+		master.load(IOUtils.getReader(defaultPropertiesFile, encoding));
 		
 		Properties slave = new Properties();
-		slave.load(IOUtils.getReader(langPropertiesFile, "UTF-8"));
+		slave.load(IOUtils.getReader(langPropertiesFile, encoding));
 		
 		OdfSpreadsheetDocument spreadsheet = OdfSpreadsheetDocument.newSpreadsheetDocument();
 		
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/TableToProperties.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/TableToProperties.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/TableToProperties.java	(revision 3905)
@@ -17,6 +17,7 @@
 	String lang;
 	
 	public TableToProperties(File tableFile, String lang) {
+		
 		this.tableFile = tableFile;
 		this.lang = lang;
 	}
@@ -96,7 +97,7 @@
 //		
 //		System.out.println("NEWPROPERTIES: "+newProperties);
 //		
-//		PrintWriter writer = IOUtils.getWriter(new File("/home/mdecorde/TEMP/newvalues_default.properties"), "iso-8859-1");
+//		PrintWriter writer = IOUtils.getWriter(new File("/home/mdecorde/TEMP/newvalues_default.properties"), "UTF-8");
 //		newProperties.store(writer, "");
 //		writer.close();
 		
@@ -104,7 +105,7 @@
 		Properties previousOKProperties = new TableToProperties(new File("/home/mdecorde/TEMP/messagespaskc.odt"), "default").convert();
 		
 		File newValuesPropertiesFile = new File("/home/mdecorde/TEMP/newvalues_default.properties");
-		BufferedReader reader = IOUtils.getReader(newValuesPropertiesFile, "iso-8859-1");
+		BufferedReader reader = IOUtils.getReader(newValuesPropertiesFile, "UTF-8");
 		Properties newProperties2 = new Properties();
 		newProperties2.load(reader);
 		reader.close();
@@ -113,7 +114,7 @@
 			previousOKProperties.setProperty(k.toString(), newProperties2.getProperty(k.toString()));
 		}
 		
-		PrintWriter writer = IOUtils.getWriter(new File("/home/mdecorde/TEMP/bundle.properties"), "UTF-8");
+		PrintWriter writer = IOUtils.getWriter(new File("/home/mdecorde/TEMP/bundle.properties"), "iso-8859-1");
 		previousOKProperties.store(writer, "");
 		writer.close();
 	}
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/TableFileToPropertiesFile.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/TableFileToPropertiesFile.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/TableFileToPropertiesFile.java	(revision 3905)
@@ -22,7 +22,12 @@
 		
 		Properties slave = new TableToProperties(tableFile, lang).convert();
 		
-		PrintWriter writer = IOUtils.getWriter(propertiesFile, "iso-8859-1");
+		String encoding = "UTF-8";
+		if (tableFile.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		PrintWriter writer = IOUtils.getWriter(propertiesFile, encoding);
 		slave.store(writer, "");
 		writer.close();
 		
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindMessagesToBind.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindMessagesToBind.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindMessagesToBind.java	(revision 3905)
@@ -40,7 +40,6 @@
 	
 	private int processSourceFile(File sourceFile, boolean searchOnlyExternalized) {
 		
-		
 		// BufferedReader reader = IOUtils.getReader(sourceFile)
 		// String line = reader.readLine();
 		this.searchOnlyExternalized = searchOnlyExternalized;
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportMessagesTable.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportMessagesTable.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportMessagesTable.java	(revision 3905)
@@ -60,8 +60,13 @@
 			}
 		};
 		
-		slave.load(IOUtils.getReader(langPropertiesFile, "UTF-8"));
+		String encoding = "UTF-8";
+		if (prefix.startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
 		
+		slave.load(IOUtils.getReader(langPropertiesFile, encoding));
+		
 		OdfTextDocument doc = OdfTextDocument.loadDocument(tableFile);
 		OdfTable table = doc.getTableList(false).get(0);
 		
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportMessagesToOneFile.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportMessagesToOneFile.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportMessagesToOneFile.java	(revision 3905)
@@ -26,6 +26,7 @@
 public class ExportMessagesToOneFile {
 
 	public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
+		
 		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager();
 		LinkedHashMap<File, PluginMessagesManager> h = wmm.getPluginMessages();
 
@@ -73,7 +74,7 @@
 			System.out.println(lang+" "+mergedProps.get(lang).size());
 			File mergedPropFile = new File(wmm.getWorkspaceLocation(), "bundles/org.txm.translate.rcp/messages"+lang+".properties");
 			try {
-				mergedProps.get(lang).store(IOUtils.getWriter(mergedPropFile), "compiled messages for lang="+lang);
+				mergedProps.get(lang).store(IOUtils.getWriter(mergedPropFile, "iso-8859-1"), "compiled messages for lang="+lang);
 				System.out.println("See: "+mergedPropFile);
 			} catch (IOException e) {
 				// TODO Auto-generated catch block
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FixEncodingDeclarationInMessagesPropertiesFiles.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FixEncodingDeclarationInMessagesPropertiesFiles.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FixEncodingDeclarationInMessagesPropertiesFiles.java	(revision 3905)
@@ -0,0 +1,66 @@
+package org.txm.rcp.translate.devtools;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.LinkedHashMap;
+import java.util.Properties;
+
+import org.txm.rcp.translate.i18n.PluginMessagesManager;
+import org.txm.rcp.translate.i18n.WorkspaceMessagesManager;
+import org.txm.utils.io.IOUtils;
+
+/**
+ * Test properties files :
+ * - no duplicated key
+ * - no empty message
+ * 
+ * @author mdecorde
+ *
+ */
+public class FixEncodingDeclarationInMessagesPropertiesFiles {
+	
+	public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
+		WorkspaceMessagesManager wmm = new WorkspaceMessagesManager();
+		LinkedHashMap<File, PluginMessagesManager> h = wmm.getPluginMessages();
+		
+		String langs[] = {"", "_fr", "_ru"};
+		
+		System.out.println("Fetching messages...");
+		for (File project : h.keySet()) {
+			
+			File settingsDir = new File(project, ".settings");
+			File ressourcePrefFile = new File(settingsDir, "org.eclipse.core.resources.prefs");
+			Properties content = new Properties();
+			if (ressourcePrefFile.exists()) {
+				content.load(IOUtils.getReader(ressourcePrefFile));
+			}
+			PluginMessagesManager messages = h.get(project);
+			//System.out.println(" "+messages.getMessageFullName()+" -> "+messages.getMessageKeys().size());
+			
+			//			System.out.println("M"+project+"? "+messages.getMessageFile());
+			
+			boolean modified = false;
+			
+			for (String lang : langs) {
+				File propFile = messages.getFile2lang().getKey("messages"+lang);
+				if (propFile == null) continue;
+				//System.out.println("M="+propFile);
+				String relPath = propFile.getAbsolutePath().substring(project.getAbsolutePath().length());
+				if (content.containsKey("encoding/"+relPath) && content.get("encoding/"+relPath).equals("UTF-8")) {
+					System.out.println("OK UTF8: "+propFile);
+				} else {
+					System.out.println("KO UTF8: "+propFile);
+					content.put("encoding/"+relPath, "UTF-8");
+					modified = true;
+				}
+			}
+			
+			if (modified) {
+				System.out.println("Fixing pref file");
+				content.store(IOUtils.getWriter(ressourcePrefFile), "");
+			}
+		}
+	}
+}

Property changes on: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FixEncodingDeclarationInMessagesPropertiesFiles.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/FindBugsInPropertiesFiles.java	(revision 3905)
@@ -5,11 +5,9 @@
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.LinkedHashMap;
-import java.util.Properties;
 
 import org.txm.rcp.translate.i18n.PluginMessagesManager;
 import org.txm.rcp.translate.i18n.WorkspaceMessagesManager;
-import org.txm.utils.io.IOUtils;
 
 /**
  * Test properties files :
@@ -30,37 +28,13 @@
 		System.out.println("Fetching messages...");
 		for (File project : h.keySet()) {
 			
-			File settingsDir = new File(project, ".settings");
-			File ressourcePrefFile = new File(settingsDir, "org.eclipse.core.resources.prefs");
-			Properties content = new Properties();
-			if (ressourcePrefFile.exists()) {
-				content.load(IOUtils.getReader(ressourcePrefFile));
-			}
 			PluginMessagesManager messages = h.get(project);
-			//System.out.println(" "+messages.getMessageFullName()+" -> "+messages.getMessageKeys().size());
 			
-			//			System.out.println("M"+project+"? "+messages.getMessageFile());
-			
-			boolean modified = false;
-			
 			for (String lang : langs) {
 				File propFile = messages.getFile2lang().getKey("messages"+lang);
 				if (propFile == null) continue;
-				//System.out.println("M="+propFile);
-				String relPath = propFile.getAbsolutePath().substring(project.getAbsolutePath().length());
-				if (content.containsKey("encoding/"+relPath) && content.get("encoding/"+relPath).equals("UTF-8")) {
-					System.out.println("OK UTF8: "+propFile);
-				} else {
-					System.out.println("KO UTF8: "+propFile);
-					content.put("encoding/"+relPath, "UTF-8");
-					modified = true;
-				}
+				
 			}
-			
-			if (modified) {
-				System.out.println("Fixing pref file");
-				content.store(IOUtils.getWriter(ressourcePrefFile), "");
-			}
 		}
 	}
 }
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportOSGiXMLToOneFile.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportOSGiXMLToOneFile.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportOSGiXMLToOneFile.java	(revision 3905)
@@ -79,7 +79,7 @@
 			System.out.println(lang+" "+mergedProps.get(lang).size());
 			File mergedPropFile = new File(wmm.getWorkspaceLocation(), "bundles/org.txm.translate.rcp/bundle"+lang+".properties");
 			try {
-				mergedProps.get(lang).store(IOUtils.getWriter(mergedPropFile), "compiled messages for lang="+lang);
+				mergedProps.get(lang).store(IOUtils.getWriter(mergedPropFile, "iso-8859-1"), "compiled messages for lang="+lang);
 				System.out.println("See: "+mergedPropFile);
 			} catch (IOException e) {
 				// TODO Auto-generated catch block
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/I18nDiff.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/I18nDiff.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/I18nDiff.groovy	(revision 3905)
@@ -12,28 +12,28 @@
 	Properties values1, values2;
 	File file1;
 	File file2;
-
+	
 	def notInValues1, notInValues2
 	I18nDiff(File file1, File file2) {
 		this.file1 = file1
 		this.file2 = file2
 		values1 = getValues(file1)
 		values2 = getValues(file2)
-
+		
 		def inter = values1.keySet().intersect(values2.keySet());
 		notInValues1 = values2.keySet().minus(values1.keySet());
 		notInValues2 = values1.keySet().minus(values2.keySet());
-
+		
 		println "not in $file1"
 		for(String key : notInValues1)
 			if (key.trim().length() > 0)
 				println key+" = "+values2.get(key)
-
+		
 		println "not in $file2"
 		for(String key : notInValues2)
 			if (key.trim().length() > 0)
 				println key+" = "+values1.get(key)
-
+		
 		//		println "values diff"
 		//
 		//		for(String key : inter ) {
@@ -41,23 +41,29 @@
 		//				println key+" = "+values1.get(key)+" != "+values2.get(key)
 		//		}
 	}
-
+	
 	public void synchronizeFromF1toF2() {
 		
-		for(String key : notInValues2) {
+		for (String key : notInValues2) {
 			if (key.trim().length() > 0)
 				values2.setProperty(key, "NA_"+values1.get(key));
 		}
 		
-		for(String key : notInValues1)
+		for (String key : notInValues1) {
 			if (key.trim().length() > 0)
 				values2.remove(key)
-				
-		file2.withWriter("iso-8859-1") { writer ->
+		}
+		
+		String encoding = "UTF-8";
+		if (file2.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		file2.withWriter(encoding) { writer ->
 			values2.store(writer, "")
 		}
 	}
-
+	
 	/**
 	 * Gets the values.
 	 *
@@ -65,15 +71,23 @@
 	 * @return the values
 	 */
 	public Properties getValues(File file) {
+		
 		Properties props = new Properties();
-		file.withReader("iso-8859-1") { input->
+		
+		String encoding = "UTF-8";
+		if (file.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		file.withReader(encoding) { input->
 			props.load(input);
 			input.close()
 		}
 		return props;
 	}
-
+	
 	public static void main(String[] args) {
+		
 		String userhome = System.getProperty("user.home");
 		File f1 = new File(userhome, "workspace047/org.txm.rcp/OSGI-INF/l10n/bundle.properties")
 		File f2 = new File(userhome, "workspace047/org.txm.rcp/OSGI-INF/l10n/bundle_fr.properties")
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/MergeExternalizedStringFiles.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/MergeExternalizedStringFiles.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/MergeExternalizedStringFiles.groovy	(revision 3905)
@@ -57,7 +57,13 @@
 	public String findBundle(File message)
 	{
 		String ret;
-		message.eachLine("iso-8859-1") {
+		
+		String encoding = "UTF-8";
+		if (message.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		message.eachLine(encoding) {
 			if (it.contains("private static final String BUNDLE_NAME = ")) {
 				int start = it.indexOf("\"")
 				int end = it.lastIndexOf("\"")
@@ -122,13 +128,15 @@
 		//      Lang            Key     externalized string 
 		HashMap<String, HashMap<String, String>> externalizedLines = [:];
 		for (File source : externalized) {
+			
 			def lines = new HashMap<String, String>();
 			externalizedLines.put(source.getName(), lines);
-			source.eachLine("iso-8859-1"){
+			source.eachLine("UTF-8") {
+				
 				if (it =~ ".+=.+") {
 					int idx = it.indexOf("=");
 					lines.put(it.substring(0, idx), it.substring(idx+1))
-				} else if(it =~ ".+=\$") {
+				} else if (it =~ ".+=\$") {
 					int idx = it.indexOf("=")
 					String key = it.substring(0, idx)
 					String value = ""
@@ -139,7 +147,7 @@
 		
 		// get references keys
 		HashSet<String> refKeys = new HashSet<String>();
-		refClass.eachLine("iso-8859-1") {
+		refClass.eachLine("UTF-8") {
 			if (it =~ ".+public static String .+")
 				refKeys << it.trim()
 		}
@@ -159,7 +167,7 @@
 			// merge externalized strings
 			for (File source : srcExternalized) {
 				def lines = externalizedLines.get(source.getName());
-				source.eachLine("iso-8859-1") {
+				source.eachLine("UTF-8") {
 					if (it =~ ".+=.+") {
 						int idx = it.indexOf("=")
 						String key = it.substring(0, idx)
@@ -187,7 +195,7 @@
 				println  srcExternalized
 				continue;
 			}
-			srcClass.eachLine("iso-8859-1"){
+			srcClass.eachLine("UTF-8"){
 				if(it =~ ".+public static String .+")
 				{
 //					if(refKeys.contains(it.trim()))
@@ -243,7 +251,7 @@
 		// write externalized lines
 		for(File source : externalized)
 		{
-			source.withWriter("iso-8859-1") { out ->
+			source.withWriter("UTF-8") { out ->
 				def hash = externalizedLines.get(source.getName())
 				def keys = hash.keySet();
 				keys = keys.sort()
@@ -254,7 +262,7 @@
 		}
 
 		// write classRef File
-		refClass.withWriter("iso-8859-1") { out ->			
+		refClass.withWriter("UTF-8") { out ->			
 			// write start
 			out.writeLine('''
 package org.txm.scripts.;
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/IsStringUsedInPlugin.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/IsStringUsedInPlugin.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/IsStringUsedInPlugin.groovy	(revision 3905)
@@ -16,7 +16,13 @@
 		}
 
 		props = new Properties();
-		propertyFile.withReader("iso-8859-1") { input->
+		
+		String encoding = "UTF-8";
+		if (propertyFile.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		propertyFile.withReader(encoding) { input->
 			props.load(input);
 			input.close()
 		}
@@ -44,7 +50,13 @@
 
 	public boolean writeFixes(File propertyFile) {
 		if (props == null) return false;
-		propertyFile.withWriter("iso-8859-1") { output ->
+		
+		String encoding = "UTF-8";
+		if (propertyFile.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		propertyFile.withWriter(encoding) { output ->
 			props.store(output, "")
 		}
 		return true;
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/GetStringsFromPropertiesFile.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/GetStringsFromPropertiesFile.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/GetStringsFromPropertiesFile.groovy	(revision 3905)
@@ -14,15 +14,17 @@
 File oldNLSClassFile = new File(oldProjectMessagesPackage, "TBXMessages.java");
 def langs = ["_fr", "", "_ru"]
 for (def lang : langs) {
+	
 	println "LANG=$lang"
 	Properties oldProperties = new Properties();
 	File oldMessageFile = new File(oldProjectMessagesPackage, "messages${lang}.properties")
 	oldProperties.load(IOUtils.getReader(oldMessageFile, "UTF-8"));
 	Properties newProperties = new Properties();
 	File newMessageFile = new File(newProjectMessagesPackage, "messages${lang}.properties")
-	if (newMessageFile.exists())
+	if (newMessageFile.exists()) {
 		newProperties.load(IOUtils.getReader(newMessageFile, "UTF-8"));
-		
+	}
+	
 	newNLSClassFile.getText("UTF-8").findAll("public static String [^;]+;") { key ->
 		key = key.substring(21, key.length()-1)
 		
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java	(revision 3905)
@@ -261,7 +261,7 @@
 					for (File propFile : osgiInf.listFiles(IOUtils.HIDDENFILE_FILTER)) {
 						if (propFile.getName().startsWith("bundle") && propFile.getName().endsWith(".properties")) {
 							Properties props = new Properties();
-							props.load(IOUtils.getReader(propFile, "ISO-8859-1"));
+							props.load(IOUtils.getReader(propFile, "iso-8859-1"));
 							HashMap<String, String> h = new HashMap<>();
 							for (Object k : props.keySet())
 								h.put(k.toString(), props.getProperty(k.toString()));
@@ -696,15 +696,22 @@
 					propFile.delete();
 					newPropFile = propFile;
 				}
+				
+				String encoding = "UTF-8";
+				if (newPropFile.getName().startsWith("bundle")) {
+					encoding = "iso-8859-1";
+				}
+				
+				
 				if (propFile.getName().contains("_ru.properties")) {
 					utf8fixes = true;
 					cmds.append("native2ascii " + newPropFile + " > " + newPropFile + ".tmp\n");
 					cmds.append("rm " + newPropFile + "\n");
 					cmds.append("mv " + newPropFile + ".tmp " + newPropFile + "\n");
-					props.store(IOUtils.getWriter(newPropFile, "UTF-8"), "TXM OSGI messages generated by the PluginMessagesManager class");
+					props.store(IOUtils.getWriter(newPropFile, encoding), "TXM OSGI messages generated by the PluginMessagesManager class");
 				}
 				else {
-					props.store(IOUtils.getWriter(newPropFile, "ISO-8859-1"), "TXM OSGI messages generated by the PluginMessagesManager class");
+					props.store(IOUtils.getWriter(newPropFile, encoding), "TXM OSGI messages generated by the PluginMessagesManager class");
 				}
 			}
 			if (utf8fixes) {
@@ -775,6 +782,7 @@
 						out.println("\t");
 					}
 					for (String key : newKeys) {
+						
 						if (writtenKeys.contains(key)) continue; // key already written
 						out.println("\tpublic static String " + key + ";");
 						writtenKeys.add(key);
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java	(revision 3905)
@@ -323,6 +323,7 @@
 			PluginMessagesManager pm = pms.get(pmk);
 			System.out.println("PMK="+pmk+" messages="+pm.getMessageKeys().size()+" osgi="+pm.getOsgiKeys().size()); 
 		}
+		
 		//wmm.dumpUsedKeysFilesIndex();
 		//wmm.saveKeyModificationsInSources();
 	}
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/FixExternalizedDuplicatedStrings.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/FixExternalizedDuplicatedStrings.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/FixExternalizedDuplicatedStrings.groovy	(revision 3905)
@@ -10,12 +10,14 @@
 class FixExternalizedDuplicatedStrings {
 	
 	static main(args) {
+		
 //		File propertyFile = new File("/home/mdecorde/Bureau/Experiences/rcp/messages.properties");
 //		File messageClass = new File("/home/mdecorde/Bureau/Experiences/rcp/Messages.java");
 //		File srcdirectory = new File("/home/mdecorde/Bureau/Experiences/rcp");
 		File propertyFile = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcp/messages.properties");
 		File messageClass = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcp/Messages.java");
 		File srcdirectory = new File("/home/mdecorde/workspace37/org.txm.rcp/src/main/java/org/txm/rcp");
+		
 		if (!(propertyFile.exists() && propertyFile.canRead() && propertyFile.canWrite() && propertyFile.isFile())) {
 			println "error file : "+propertyFile
 			return
@@ -24,16 +26,20 @@
 		// build hash of externalised Strings
 		//						  key	  externalized string
 		def entries = new HashMap<String, String>()
-		propertyFile.eachLine("iso-8859-1"){
-			if(it =~ ".+=.+")
-			{
+		
+		String encoding = "UTF-8";
+		if (propertyFile.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		propertyFile.eachLine(encoding){
+			if (it =~ ".+=.+") {
 				int idx = it.indexOf("=")
 				String key = it.substring(0, idx)
 				String value = it.substring(idx+1)
 				entries.put(key, value)
 			}
-			else if(it =~ ".+=\$")
-			{
+			else if (it =~ ".+=\$") {
 				int idx = it.indexOf("=")
 				String key = it.substring(0, idx)
 				String value = ""
@@ -45,8 +51,9 @@
 		def hash = entries
 		def reverse = [:]
 		hash.each{
-			if(reverse[it.value] == null)
+			if (reverse[it.value] == null) {
 				reverse[it.value] = []
+			}
 			reverse[it.value] << it.key
 		};
 		
@@ -56,15 +63,14 @@
 		
 		// translate dictionnary
 		def dictionnary = [:]
-		for(def value : reverse.keySet())
-		{
+		for (def value : reverse.keySet()) {
+			
 			def keys = reverse[value];
 			def first = keys[0];
-			for(int i = 1 ; i < keys.size() ; i++) // the first key will not be removed
+			for (int i = 1 ; i < keys.size() ; i++) // the first key will not be removed
 			{
 				def key = keys.get(i)
-				if(key != first)
-				{
+				if (key != first) {
 					dictionnary.put(key , first)
 					println key+ " >> "+first
 				}
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/Merge2PropertiesFile.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/Merge2PropertiesFile.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/Merge2PropertiesFile.groovy	(revision 3905)
@@ -4,9 +4,9 @@
 File propFile2 = new File("/home/mdecorde/workspace047/org.txm.rcp.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages_fr.properties")
 
 Properties props1 = new Properties()
-props1.load(propFile1.newReader("iso-8859-1"))
+props1.load(propFile1.newReader("UTF-8"))
 Properties props2 = new Properties()
-props2.load(propFile2.newReader("iso-8859-1"))
+props2.load(propFile2.newReader("UTF-8"))
 
 println "props1.size = "+props1.size()
 println "props2.size = "+props2.size()
@@ -17,4 +17,4 @@
 }
 
 println "props2.size AFTER = "+props2.size()
-props2.store(propFile2.newWriter("iso-8859-1"), "$propFile1 + $propFile2")
\ No newline at end of file
+props2.store(propFile2.newWriter("UTF-8"), "$propFile1 + $propFile2")
\ No newline at end of file
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/ExternalizationFilesUpdater.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/ExternalizationFilesUpdater.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/ExternalizationFilesUpdater.java	(revision 3905)
@@ -91,8 +91,14 @@
 	 */
 	public List<String> getEntries(File file) throws IOException
 	{
-		List<String> entries = new ArrayList<>();
-		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file) , "iso-8859-1"));
+		List<String> entries = new ArrayList<>();
+		
+		String encoding = "UTF-8";
+		if (file.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file) , encoding));
 		String line = reader.readLine();
 		while (line != null) {
 			String[] split = line.split("=", 2);
@@ -114,16 +120,25 @@
 	 * @throws IOException 
 	 */
 	public HashMap<String, String> getValues(File file) throws IOException {
-		HashMap<String, String> values = new HashMap<String, String>();
-		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "iso-8859-1"));
+		HashMap<String, String> values = new HashMap<String, String>();
+		
+		String encoding = "UTF-8";
+		if (file.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
+		
+		
+		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
 		String line = reader.readLine();
-		while (line != null) {
+		while (line != null) {
+			
 			String[] split = line.split("=");
 			if (split.length > 0) {
 				String key = split[0];
 				String concat = "";
-				for (int i = 1; i < split.length; i++)
-					concat += split[i];
+				for (int i = 1; i < split.length; i++) {
+					concat += split[i];
+				}
 				values.put(key, concat);
 			}
 			line = reader.readLine();
@@ -137,7 +152,8 @@
 	 */
 	public void processFoundDirectories() throws IOException
 	{
-		for (File dirfile : dirfiles) {
+		for (File dirfile : dirfiles) {
+			
 			System.out.println("DIRECTORY : "+dirfile);
 			List<File> files = propertyfiles.get(dirfile);
 			for (File f : files) {
@@ -167,12 +183,15 @@
 						
 						this.fileentries.put(f, this.fileentries.get(reference)); // update file entries
 						
-						if (tmp1.size() > 0 || refentries.size() > 0)
-							System.out.println( " "+f.getName());
-						if (tmp1.size() > 0)
+						if (tmp1.size() > 0 || refentries.size() > 0) {
+							System.out.println( " "+f.getName());
+						}
+						if (tmp1.size() > 0) {
 							System.out.println("  Removed keys : "+tmp1);
-						if (refentries.size() > 0)
-							System.out.println("  Added keys : "+refentries);
+						}
+						if (refentries.size() > 0) {
+							System.out.println("  Added keys : "+refentries);
+						}
 					}
 				}
 			}
@@ -183,19 +202,23 @@
 	 * Update files.
 	 * @throws IOException 
 	 */
-	public void updateFiles() throws IOException
-	{
-		for(File dirfile : dirfiles)
-		{
+	public void updateFiles() throws IOException {
+		
+		for (File dirfile : dirfiles) {
+			
 			List<File> files = propertyfiles.get(dirfile);
-			for(File f : files)
-			{
+			for (File f : files) {
+				
 				List<String> entries =  this.fileentries.get(f);
 				HashMap<String, String> values = this.fileentriesvalues.get(f);
+				
+				String encoding = "UTF-8";
+				if (f.getName().startsWith("bundle")) {
+					encoding = "iso-8859-1";
+				}
 				
-				Writer writer = new OutputStreamWriter(new FileOutputStream(f) , "iso-8859-1");
-				for(String entry : entries)
-				{
+				Writer writer = new OutputStreamWriter(new FileOutputStream(f) , encoding);
+				for (String entry : entries) {
 					writer.write(entry+"="+values.get(entry)+"\n");
 				}
 				writer.close();
@@ -209,32 +232,33 @@
 	 * @param suffix the suffix
 	 * @throws IOException 
 	 */
-	public void createMissingFiles(String suffix) throws IOException
-	{
+	public void createMissingFiles(String suffix) throws IOException {
+		
 		System.out.println("Looking for missing messages files "+ suffix);
-		for(File dirfile : dirfiles) {
+		for (File dirfile : dirfiles) {
 			//println "DIRECTORY : "+dirfile
 			File reference = null;
 			String lookingname = "";
 			List<File> files = propertyfiles.get(dirfile);
-			if (files.get(0).getName().startsWith("m")) {
+			if (files.get(0).getName().startsWith("m")) {
+				
 				reference = new File(dirfile,"messages.properties");
 				lookingname = "messages_"+suffix+".properties";
 			}
-			else if (files.get(0).getName().startsWith("b"))
-			{
+			else if (files.get(0).getName().startsWith("b")) {
+				
 				reference = new File(dirfile,"bundle.properties");
 				lookingname = "bundle_"+suffix+".properties";
 			}
 			
 			boolean create = true;
 			if (reference != null && reference.exists()) {
-				for(File f : files)
-				{
+				for (File f : files) {
 					if(f.getName() == lookingname)
 						create = false;
 				}
-			}
+			}
+			
 			if (create) {
 				new File(dirfile,lookingname).createNewFile();
 				System.out.println("Create file " +new File(dirfile,lookingname));
@@ -248,10 +272,11 @@
 	public String toString() {
 		
 		String rez = "";
-		for(File dirfile : dirfiles) {
+		for (File dirfile : dirfiles) {
 			rez += dirfile+"\n";
-			for(File f : propertyfiles.get(dirfile))
-				rez += "  "+f.getName()+"\n";
+			for (File f : propertyfiles.get(dirfile)) {
+				rez += "  "+f.getName()+"\n";
+			}
 		}
 		return rez;
 	}
@@ -261,8 +286,8 @@
 	 *
 	 * @param directory the directory
 	 */
-	public void scanDirectory(File directory)
-	{
+	public void scanDirectory(File directory) {
+		
 		if (!directory.exists()) {
 			System.out.println("directory '$directory' does not exists");
 			return;
@@ -272,14 +297,14 @@
 		LinkedList<File> files = new LinkedList<File>();
 		files.add(directory);
 		
-		while(!files.isEmpty()) {
+		while (!files.isEmpty()) {
 			
 			File current = files.removeFirst();
 			if (current.isDirectory()) {
 				List<File> currentpfiles = new ArrayList<>();
-				for(File sfile : current.listFiles(IOUtils.HIDDENFILE_FILTER))
-				{
-					if(sfile.isDirectory()) {
+				for (File sfile : current.listFiles(IOUtils.HIDDENFILE_FILTER)) {
+					
+					if (sfile.isDirectory()) {
 						files.add(sfile);
 					} else if(sfile.getName().endsWith(".properties") && ( sfile.getName().startsWith("messages") || sfile.getName().startsWith("bundle")) ) {
 						currentpfiles.add(sfile);
@@ -299,8 +324,8 @@
 	 * @param args the arguments
 	 * @throws IOException 
 	 */
-	public static void main(String[] args) throws IOException
-	{
+	public static void main(String[] args) throws IOException {
+		
 		String userdir = System.getProperty("user.home");
 
 		System.out.println("\nRCP\n");
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/FindDuplicatedKeyProperties.groovy
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/FindDuplicatedKeyProperties.groovy	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/FindDuplicatedKeyProperties.groovy	(revision 3905)
@@ -54,8 +54,13 @@
 
 for (def file : propertieFileToJavaFile.keySet()) {
 	Properties newProperties = new Properties();
-	newProperties.load(IOUtils.getReader(file, "UTF-8"));
+	String encoding = "UTF-8";
+	if (file.getName().startsWith("bundle")) {
+		encoding = "iso-8859-1";
+	}
 	
+	newProperties.load(IOUtils.getReader(file, encoding));
+	
 	propertiesToMessageFile[file] = newProperties;
 	messagesFileToProperties[newProperties] = file;
 	
@@ -88,6 +93,10 @@
 	def messages = [:]
 	for (def file : propertiesFiles) {
 		Properties newProperties = new Properties();
+		String encoding = "UTF-8";
+		if (file.getName().startsWith("bundle")) {
+			encoding = "iso-8859-1";
+		}
 		newProperties.load(IOUtils.getReader(file, "UTF-8"));
 		messages[file] = newProperties;
 	}
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java	(revision 3905)
@@ -120,7 +120,7 @@
 					IPath path = new Path(Toolbox.getInstallDirectory()+"/plugins");
 					srcFolder.createLink(path, IResource.ALLOW_MISSING_LOCAL, cpb);
 
-					// set the encoding bundle=iso-8859-1, messages=utf-8
+					// set the encoding bundle=UTF-8, messages=utf-8
 					ArrayList<IResource> propertiesFiles = new ArrayList<IResource>();
 					ExportTranslateProject.findPropertiesFile(srcFolder, propertiesFiles);
 					for (IResource e : propertiesFiles) {
Index: TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/ExternalizationFilesUpdater.java
===================================================================
--- TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/ExternalizationFilesUpdater.java	(revision 3904)
+++ TXM/trunk/bundles/org.txm.translate.rcp/src/org/txm/rcp/translate/ExternalizationFilesUpdater.java	(revision 3905)
@@ -90,9 +90,9 @@
 	 */
 	public static List<String> getEntries(File file) throws IOException {
 		List<String> entries = new ArrayList<>();
-		String encoding = "iso-8859-1";
-		if (file.getName().startsWith("message")) { // TXM manages messages.properties encoded in UTF-8
-			encoding = "UTF-8";
+		String encoding = "UTF-8";
+		if (file.getName().startsWith("bundle")) { // TXM manages messages.properties encoded in UTF-8
+			encoding = "iso-8859-1";
 		}
 		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
 		String line = reader.readLine();
@@ -118,9 +118,9 @@
 	public static HashMap<String, String> getValues(File file) throws IOException {
 		HashMap<String, String> values = new HashMap<>();
 		
-		String encoding = "iso-8859-1";
-		if (file.getName().startsWith("message")) { // TXM manages messages.properties encoded in UTF-8
-			encoding = "UTF-8";
+		String encoding = "UTF-8";
+		if (file.getName().startsWith("bundle")) { // TXM manages messages.properties encoded in UTF-8
+			encoding = "iso-8859-1";
 		}
 		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
 		
@@ -200,7 +200,7 @@
 				if (debug) System.out.println(" U " + f + " <- " + entries);
 				HashMap<String, String> values = this.fileentriesvalues.get(f);
 				
-				OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(f), "iso-8859-1");
+				OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
 				for (String entry : entries) {
 					writer.write(entry + "=" + values.get(entry) + "\n");
 				}
