function makeCookieObject(cookie)
{
// Remember the raw value.
var rawValue = cookie.value;
// Unescape '+' characters that are used to encode a space.
// This isn't done by unescape method.
var value = cookie.value;
if (value) {
value = value.replace(/\+/g, " ");
}
var optionValue = "";
var optionRowValue = "";
if ( value.indexOf("%") != -1 ) {
try {
optionValue = GetEscapeCodeType(value);
optionRowValue = " : charset( " + optionValue + " )";
if ( optionValue == "UTF8" ) {
optionValue = UnescapeUTF8(value);
}
if ( optionValue == "EUCJP" ) {
optionValue = UnescapeEUCJP(value);
}
if ( optionValue == "SJIS" ) {
optionValue = UnescapeSJIS(value);
}
if ( optionValue == "Unicode" ) {
optionValue = unescape(value);
}
} catch( e ) { optionValue = value }
}
else {
optionValue = value;
}
var c = {
name : cookie.name,
value : optionValue,
isDomain : cookie.isDomain,
host : cookie.host,
path : cookie.path,
isSecure : cookie.isSecure,
expires : cookie.expires,
isHttpOnly : cookie.isHttpOnly,
rawValue : rawValue + optionRowValue
};
return c;
}