Author: jalkanen
Date: Sat May 10 09:58:30 2008
New Revision: 655130

URL: http://svn.apache.org/viewvc?rev=655130&view=rev
Log:
Login cookies are now written in UTF-8 instead of platform default encoding.

Modified:
    
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java?rev=655130&r1=655129&r2=655130&view=diff
==============================================================================
--- 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
 (original)
+++ 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/login/CookieAuthenticationLoginModule.java
 Sat May 10 09:58:30 2008
@@ -93,6 +93,8 @@
 
     /**
      * @see javax.security.auth.spi.LoginModule#login()
+     * 
+     * [EMAIL PROTECTED]
      */
     public boolean login() throws LoginException
     {
@@ -122,7 +124,7 @@
 
                     try
                     {
-                        in = new FileReader( cookieFile );
+                        in = new BufferedReader( new InputStreamReader( new 
FileInputStream( cookieFile ), "UTF-8" ) );
                         String username = FileUtil.readContents( in );
 
                         if ( log.isDebugEnabled() )
@@ -255,7 +257,10 @@
 
         try
         {
-            out = new FileWriter(cf);
+            //
+            //  Write the cookie content to the cookie store file.
+            //
+            out = new BufferedWriter( new OutputStreamWriter( new 
FileOutputStream(cf), "UTF-8" ) );
             FileUtil.copyContents( new StringReader(username), out );
 
             if( log.isDebugEnabled() )


Reply via email to