summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VpnProfile.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-02-05 09:49:06 +0100
committerArne Schwabe <arne@rfc2549.org>2013-02-05 09:49:06 +0100
commit1a65622af5d97bfcf56c84e90e40bfd0b214e43b (patch)
treed4ba0b20e995fd9cfc5030c3d889c2a963b10b73 /src/de/blinkt/openvpn/VpnProfile.java
parent84ccab8d6510835316b0a89085dae31801bd50dc (diff)
Fix Locale related errors/bugs. Update … to unicode replacement. Fix the speed display.
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 6f21397e..37e9b2ff 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -15,6 +15,7 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Collection;
+import java.util.Locale;
import java.util.UUID;
import java.util.Vector;
@@ -391,12 +392,13 @@ public class VpnProfile implements Serializable{
//! Put inline data inline and other data as normal escaped filename
private String insertFileData(String cfgentry, String filedata) {
if(filedata==null) {
+ // TODO: generate good error
return String.format("%s %s\n",cfgentry,"missing");
}else if(filedata.startsWith(VpnProfile.INLINE_TAG)){
String datawoheader = filedata.substring(VpnProfile.INLINE_TAG.length());
- return String.format("<%s>\n%s\n</%s>\n",cfgentry,datawoheader,cfgentry);
+ return String.format(Locale.ENGLISH,"<%s>\n%s\n</%s>\n",cfgentry,datawoheader,cfgentry);
} else {
- return String.format("%s %s\n",cfgentry,openVpnEscape(filedata));
+ return String.format(Locale.ENGLISH,"%s %s\n",cfgentry,openVpnEscape(filedata));
}
}
@@ -465,7 +467,7 @@ public class VpnProfile implements Serializable{
long nm = 0xffffffffl;
nm = (nm << (32-len)) & 0xffffffffl;
- String netmask =String.format("%d.%d.%d.%d", (nm & 0xff000000) >> 24,(nm & 0xff0000) >> 16, (nm & 0xff00) >> 8 ,nm & 0xff );
+ String netmask =String.format(Locale.ENGLISH,"%d.%d.%d.%d", (nm & 0xff000000) >> 24,(nm & 0xff0000) >> 16, (nm & 0xff00) >> 8 ,nm & 0xff );
return parts[0] + " " + netmask;
}