Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-04-12 18:18:56 +0000
committerAndrew Niefer2010-04-12 18:18:56 +0000
commit2e911067afdde1a3153dc49680efb48fd05422ce (patch)
tree30c2aebba5353840900a7bc57014f456e463ecda /bundles/org.eclipse.equinox.simpleconfigurator.manipulator
parentf79eae3a74746ff8ddd071395e6c4aa3d98ddcc9 (diff)
downloadrt.equinox.p2-2e911067afdde1a3153dc49680efb48fd05422ce.tar.gz
rt.equinox.p2-2e911067afdde1a3153dc49680efb48fd05422ce.tar.xz
rt.equinox.p2-2e911067afdde1a3153dc49680efb48fd05422ce.zip
bug 289644 - bundles.info should be in utf-8v20100416
Diffstat (limited to 'bundles/org.eclipse.equinox.simpleconfigurator.manipulator')
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
index 1a80ec0c3..84c8c7b31 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
+++ b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
@@ -15,6 +15,7 @@ import java.util.Comparator;
import org.eclipse.equinox.internal.frameworkadmin.equinox.Messages;
import org.eclipse.equinox.internal.frameworkadmin.utils.Utils;
import org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo;
+import org.eclipse.equinox.internal.simpleconfigurator.utils.SimpleConfiguratorUtils;
import org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
import org.osgi.framework.Version;
@@ -23,6 +24,7 @@ public class SimpleConfiguratorManipulatorUtils {
private static final String VERSION_PREFIX = "#version="; //$NON-NLS-1$
private static final String VERSION_1 = "1"; //$NON-NLS-1$
private static final Version OLD_STYLE_SIMPLE_CONFIGURATOR_VERSION = new Version("1.0.100.v20081206"); //$NON-NLS-1$
+ private static final Version DEFAULT_ENCODING_CONFIGURATOR_VERSION = new Version("2.0.0.v20100329"); //$NON-NLS-1$
public static void writeConfiguration(BundleInfo[] simpleInfos, File outputFile) throws IOException {
if (!Utils.createParentDir(outputFile)) {
@@ -69,17 +71,26 @@ public class SimpleConfiguratorManipulatorUtils {
BufferedWriter writer = null;
boolean oldStyle = false;
+ boolean utf8 = true;
for (int i = 0; i < simpleInfos.length; i++) {
if (SimpleConfiguratorManipulator.SERVICE_PROP_VALUE_CONFIGURATOR_SYMBOLICNAME.equals(simpleInfos[i].getSymbolicName())) {
Version version = new Version(simpleInfos[i].getVersion());
if (version.compareTo(OLD_STYLE_SIMPLE_CONFIGURATOR_VERSION) < 0)
oldStyle = true;
+ if (version.compareTo(DEFAULT_ENCODING_CONFIGURATOR_VERSION) <= 0)
+ utf8 = false;
break;
}
}
- writer = new BufferedWriter(new OutputStreamWriter(stream));
- // version line
+ if (utf8) {
+ writer = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8")); //$NON-NLS-1$
+ //encoding is expected to be the first line
+ writer.write(SimpleConfiguratorUtils.ENCODING_UTF8);
+ writer.newLine();
+ } else {
+ writer = new BufferedWriter(new OutputStreamWriter(stream));
+ }
writer.write(createVersionLine());
writer.newLine();

Back to the top