From: <st...@us...> - 2010-10-18 15:28:12
|
Revision: 8420 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=8420&view=rev Author: steve_l Date: 2010-10-18 15:28:05 +0000 (Mon, 18 Oct 2010) Log Message: ----------- SFOS-1539 switch utf-8 encoding in SFParser to its proper name UTF-8, and place in a constant Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/parser/SFParser.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/parser/SFParser.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/parser/SFParser.java 2010-10-15 15:37:25 UTC (rev 8419) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/parser/SFParser.java 2010-10-18 15:28:05 UTC (rev 8420) @@ -82,6 +82,7 @@ private ReaderLanguageParser parser = null; /* cache the real unparser for the language */ private WriterLanguageUnparser unparser = null; + private static final String SF_ENCODING = "UTF-8"; /** * Constructor for an instance of the parser for the default language. @@ -297,7 +298,7 @@ */ public Phases sfParse(InputStream is) throws SmartFrogParseException { try { - return sfParse(new InputStreamReader(is, "utf-8"),null); + return sfParse(new InputStreamReader(is, SF_ENCODING),null); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of stream", e); } @@ -317,7 +318,7 @@ */ public Phases sfParse(InputStream is, String codebase) throws SmartFrogParseException { try { - return sfParse(new InputStreamReader(is, "utf-8"), codebase); + return sfParse(new InputStreamReader(is, SF_ENCODING), codebase); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of stream", e); } @@ -388,7 +389,7 @@ */ public Reference sfParseReference(InputStream is) throws SmartFrogCompilationException { try { - return sfParseReference(new InputStreamReader(is, "utf-8")); + return sfParseReference(new InputStreamReader(is, SF_ENCODING)); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of stream", e); } @@ -444,7 +445,7 @@ */ public Object sfParseAnyValue(InputStream is) throws SmartFrogCompilationException { try { - return sfParseAnyValue(new InputStreamReader(is, "utf-8")); + return sfParseAnyValue(new InputStreamReader(is, SF_ENCODING)); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of stream", e); } @@ -499,7 +500,7 @@ */ public Object sfParsePrimitiveValue(InputStream is) throws SmartFrogCompilationException { try { - return sfParsePrimitiveValue(new InputStreamReader(is, "utf-8")); + return sfParsePrimitiveValue(new InputStreamReader(is, SF_ENCODING)); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of stream", e); } @@ -550,7 +551,7 @@ public Object sfParseTags(InputStream is) throws SmartFrogCompilationException { Object o = null; try { - return sfParseTags(new InputStreamReader(is, "utf-8")); + return sfParseTags(new InputStreamReader(is, SF_ENCODING)); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of stream", e); } @@ -604,7 +605,7 @@ */ public ComponentDescription sfParseComponentDescription(InputStream is) throws SmartFrogCompilationException { try { - return sfParseComponentDescription(new InputStreamReader(is, "utf-8")); + return sfParseComponentDescription(new InputStreamReader(is, SF_ENCODING)); } catch (UnsupportedEncodingException e) { throw new SmartFrogParseException("error in encoding of string for reader", e); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |