X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.history%2Fsrc%2Forg%2Fsimantics%2Fhistory%2Fcsv%2FCSVFormatter.java;h=6cc7a2a6f09a9bf50e1c7f27eeb74651180e1df2;hb=d9d830062a16b727c65d9bbd04f519235c5ece01;hp=6610d17f2456081d73031797f44599f43cf01ffb;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.history/src/org/simantics/history/csv/CSVFormatter.java b/bundles/org.simantics.history/src/org/simantics/history/csv/CSVFormatter.java index 6610d17f2..6cc7a2a6f 100644 --- a/bundles/org.simantics.history/src/org/simantics/history/csv/CSVFormatter.java +++ b/bundles/org.simantics.history/src/org/simantics/history/csv/CSVFormatter.java @@ -12,9 +12,7 @@ package org.simantics.history.csv; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.math.BigDecimal; -import java.net.URLDecoder; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.Format; @@ -85,20 +83,12 @@ public class CSVFormatter { i.history = history; i.label = label!=null?label:""; i.variableReference = variableReference!=null?variableReference:""; - i.variableReference = unescape(i.variableReference); + i.variableReference = URIs.safeUnescape(i.variableReference); i.historyItemId = historyItemId; i.unit = unit; if ( !items.contains(i) ) items.add( i ); } - private static String unescape(String url) { - try { - return URLDecoder.decode(url, "UTF-8"); - } catch (UnsupportedEncodingException e) { - return url; - } - } - /** * Sort items by variableId, label1, label2 */ @@ -318,7 +308,7 @@ public class CSVFormatter { // Sampling based on given startTime and timeStep if(timeStep > 0) { - // Find the first sample time that contains data + // Find the first sample time that contains data if startTime < _from double n = Math.max(0, Math.ceil((_from-startTime) / timeStep)); time = startTime + n*timeStep; @@ -597,7 +587,7 @@ public class CSVFormatter { private Formatter evaluateFormatter(Format format, DecimalSeparator target) { // Probe decimal separator String onePointTwo = format.format(1.2); - System.out.println("formatted zeroPointOne: " + onePointTwo); + //System.out.println("formatted zeroPointOne: " + onePointTwo); DecimalSeparator formatSeparator; if (onePointTwo.indexOf('.') != -1) {