X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=java%2FFCGIMessage.java;h=0f474a9e0c710fcd135d34d9f212d28cd18bbff9;hb=78d3a5a53470cb38dca0d8ab08fc6210c87ace9f;hp=e0a710b27a61ae24ba9c15f25f0512310e29126c;hpb=61962ef7ec4d21c9690944abc55705c4a8636d35;p=catagits%2Ffcgi2.git diff --git a/java/FCGIMessage.java b/java/FCGIMessage.java index e0a710b..0f474a9 100644 --- a/java/FCGIMessage.java +++ b/java/FCGIMessage.java @@ -10,8 +10,9 @@ * See the file "LICENSE.TERMS" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: FCGIMessage.java,v 1.1 1999/01/31 02:45:52 roberts Exp $ + * $Id: FCGIMessage.java,v 1.4 2000/10/02 15:09:07 robs Exp $ */ +package com.fastcgi; import java.io.*; import java.util.Properties; @@ -23,7 +24,9 @@ import java.util.Properties; * dont need a stream. */ -public class FCGIMessage { +public class FCGIMessage +{ + private static final String RCSID = "$Id: FCGIMessage.java,v 1.4 2000/10/02 15:09:07 robs Exp $"; /* * Instance variables @@ -277,10 +280,15 @@ public class FCGIMessage { dest[pos++] = (byte)((valLen >> 8) & 0xff); dest[pos++] = (byte)valLen; } - name.getBytes(0, nameLen, dest, pos); - pos += nameLen; - value.getBytes(0, valLen, dest, pos); - pos += valLen; + + try { + System.arraycopy(name.getBytes("UTF-8"), 0, dest, pos, nameLen); + pos += nameLen; + + System.arraycopy(value.getBytes("UTF-8"), 0, dest, pos, valLen); + pos += valLen; + } + catch (UnsupportedEncodingException x) {} } /* @@ -341,8 +349,8 @@ public class FCGIMessage { FCGIGlobalDefs.def_FCGIParamsError); return -1; } - String strName = new String(name, 0, 0, name.length); - String strValue = new String(value, 0, 0, value.length); + String strName = new String(name); + String strValue = new String(value); props.put(strName, strValue); } return 0;