Mercurial > projects > dwt-linux
changeset 175:a481ab32da3d
ResourceBundle unescape also the quote char.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 02 Mar 2008 18:07:03 +0100 |
parents | 384b3a0c9cd7 |
children | 1fe0f5bb0ba2 |
files | dwt/dwthelper/ResourceBundle.d |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/dwthelper/ResourceBundle.d Sat Mar 01 11:53:07 2008 -0800 +++ b/dwt/dwthelper/ResourceBundle.d Sun Mar 02 18:07:03 2008 +0100 @@ -6,6 +6,7 @@ import tango.text.Util; import tango.io.Stdout; +import dwt.DWT; class ResourceBundle { @@ -34,7 +35,7 @@ while( dataIndex < data.length ){ //tango.io.Stdout.Stdout.formatln( "properties put {} startline", __LINE__ ); readLine(); - line = tango.text.Util.trim( line ); + line = line.trim(); if( line.length is 0 ){ //tango.io.Stdout.Stdout.formatln( "properties put {} was 0 length", __LINE__ ); continue; @@ -61,7 +62,8 @@ case 't': c = '\t'; break; case 'n': c = '\n'; break; case '\\': c = '\\'; break; - default: c = '?'; break; + case '\"': c = '\"'; break; + default: break; } } else{ @@ -89,11 +91,12 @@ } } if( iskeypart ){ - tango.io.Stdout.Stdout.formatln( "dwt.dwthelper.ResourceBundle ctor cannot find '='." ); + // Cannot find '=' in record + DWT.error( __FILE__, __LINE__, DWT.ERROR_INVALID_ARGUMENT ); continue; } - key = tango.text.Util.trim( key ); - value = tango.text.Util.trim(value); + key = key.trim(); + value = value.trim(); //tango.io.Stdout.Stdout.formatln( "properties put {}=>{}", key, value ); map[ key.dup ] = value.dup;