From 61db0327383a6593a9ac7fcf879bd6aa3888b40d Mon Sep 17 00:00:00 2001 From: wjoe Date: Thu, 22 Dec 2011 16:09:53 +0000 Subject: More currency fixing --- blaconvert.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/blaconvert.java b/blaconvert.java index da99216..092d7d4 100644 --- a/blaconvert.java +++ b/blaconvert.java @@ -21,7 +21,7 @@ based on code by Jamie Walters based on code by Joe Robinson - Version 1.32 + Version 1.33 CHANGELOG 1.0 - First version @@ -33,6 +33,7 @@ 1.3 - Added support for currency symbols 1.31 - Trying to add euro (probably won't work) 1.32 - Changed currency to unicode + 1.33 - More euro fixing (maybe) TODO - Raw output option - result only with no spaces/commas/units */ @@ -52,7 +53,7 @@ public class blaconvert { String sourceUnit = ""; String targetUnit = ""; String amount = ""; - String version = "1.32"; + String version = "1.33"; /* Build query from query or arguments, depending on whether arguments were given. */ @@ -125,11 +126,13 @@ public class blaconvert { } } boolean currency = false; - if(amount.startsWith("£") || amount.startsWith("$") || amount.startsWith("¥")) + if(amount.contains("\u00A3") || amount.contains("\u0024") || amount.contains("\u20AC") || + amount.contains("\u00A5") || amount.contains("\u0080")) { amount.replaceAll("\u00A3","%A3"); amount.replaceAll("\u0024","%24"); - amount.replaceAll("\u20AC","%8010"); + amount.replaceAll("\u20AC","%80"); + amount.replaceAll("\u0080","%80"); amount.replaceAll("\u00A5","%A5"); currency = true; -- cgit v1.2.3