You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2009/03/05 13:51:25 UTC
svn commit: r750448 -
/myfaces/trinidad/branches/1.2.11.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java
Author: matzew
Date: Thu Mar 5 12:51:25 2009
New Revision: 750448
URL: http://svn.apache.org/viewvc?rev=750448&view=rev
Log:
TRINIDAD-1413 - getLocalizedPattern displays currency sign in Linux
Thanks to Cale Scholl for the patch
Modified:
myfaces/trinidad/branches/1.2.11.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java
Modified: myfaces/trinidad/branches/1.2.11.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.11.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java?rev=750448&r1=750447&r2=750448&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.11.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java (original)
+++ myfaces/trinidad/branches/1.2.11.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/convert/NumberConverter.java Thu Mar 5 12:51:25 2009
@@ -770,7 +770,7 @@
// http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html
// The unicode for '¤' is: \u00A4
// The xml hex is : ¤
- int idx = pattern.indexOf("¤");
+ int idx = pattern.indexOf('\u00A4');
if (idx == -1)
return pattern;
@@ -784,19 +784,19 @@
dfs = df.getDecimalFormatSymbols();
}
- if (idx + 1 < pattern.length() && pattern.charAt(idx + 1) == '¤')
+ if (idx + 1 < pattern.length() && pattern.charAt(idx + 1) == '\u00A4')
{
// Matcher.quoteReplacement ensures that the replacement string is properly escaped.
String symbol = dfs.getInternationalCurrencySymbol();
if (symbol.length() > 0)
- pattern = pattern.replaceFirst("¤¤", Matcher.quoteReplacement(symbol));
+ pattern = pattern.replaceAll(new String(new char[] {'\u00A4', '\u00A4'}), Matcher.quoteReplacement(symbol));
}
else
{
// Matcher.quoteReplacement ensures that the replacement string is properly escaped.
String symbol = dfs.getCurrencySymbol();
if (symbol.length() > 0)
- pattern = pattern.replaceFirst("¤", Matcher.quoteReplacement(symbol));
+ pattern = pattern.replaceAll(new String(new char[] {'\u00A4'}), Matcher.quoteReplacement(symbol));
}
return pattern;