Index: JvAppStorage.pas
===================================================================
--- JvAppStorage.pas	(revision 12048)
+++ JvAppStorage.pas	(working copy)
@@ -347,6 +347,14 @@
     function DoReadString(const Path: string; const Default: string): string; virtual; abstract;
     { Stores an string value. }
     procedure DoWriteString(const Path: string; const Value: string); virtual; abstract;
+
+    { Retrieves the specified string value. If the value is not found, the Default will be
+      returned. If the value is not a string (or can't be converted to a string an EConvertError
+      exception will be raised. }
+    function DoReadWideString(const Path: string; const Default: Widestring): Widestring; virtual;
+    { Stores an string value. }
+    procedure DoWriteWideString(const Path: string; const Value: Widestring); virtual;
+
     { Retrieves the specified value into a buffer. The result holds the number of bytes actually
       retrieved. }
     function DoReadBinary(const Path: string; Buf: TJvBytes; BufSize: Integer): Integer; virtual; abstract;
@@ -1727,11 +1735,27 @@
   Result := DoReadFloat(Path, Default);
 end;
 
+function TJvCustomAppStorage.DoReadWideString(const Path: string;
+  const Default: Widestring): Widestring;
+begin
+  {$IFDEF COMPILER12_UP}
+  Result := UTF8ToWideString(RawByteString(ReadString(Path, string(UTF8Encode(Default)))));
+  {$ELSE}
+  Result := UTF8Decode(ReadString(Path, UTF8Encode(Default)));
+  {$ENDIF COMPILER12_UP}
+end;
+
 procedure TJvCustomAppStorage.DoWriteDateTime(const Path: string; Value: TDateTime);
 begin
   DoWriteFloat(Path, Value);
 end;
 
+procedure TJvCustomAppStorage.DoWriteWideString(const Path: string;
+  const Value: Widestring);
+begin
+  DoWriteString(Path,string(UTF8Encode(Value)));
+end;
+
 procedure TJvCustomAppStorage.DoError(const msg: string);
 begin
   if Assigned(OnError) then
@@ -2374,7 +2398,7 @@
     else
     begin
       try
-        if TypeInfo.Kind = tkChar then
+        if TypeInfo.Kind in [tkChar,tkWChar] then
           OrdValue := ReadIntegerInt(Path, OrdValue)
         else
           if TypeInfo.Kind = tkInteger then
@@ -2449,7 +2473,7 @@
       WriteBooleanInt(Path, OrdOfEnum(Value, GetTypeData(TypeInfo).OrdType) <> 0)
   {$ENDIF CLR}
     else
-      if TypeInfo.Kind = tkChar then
+      if TypeInfo.Kind in [tkChar, tkWchar] then
         WriteIntegerInt(Path, OrdOfEnum(Value, GetTypeData(TypeInfo).OrdType))
       else
         if TypeInfo.Kind = tkInteger then
@@ -2661,7 +2685,7 @@
         ReadSet(Path, GetPropInfo(PersObj, PropName).PropType{$IFNDEF CLR}^{$ENDIF}, TmpValue, TmpValue);
         SetOrdProp(PersObj, PropName, TmpValue);
       end;
-    tkChar, tkInteger:
+    tkChar, tkWchar, tkInteger:
       begin
         TmpValue := GetOrdProp(PersObj, PropName);
         ReadEnumeration(Path, GetPropInfo(PersObj, PropName).PropType{$IFNDEF CLR}^{$ENDIF}, TmpValue, TmpValue);
@@ -2805,7 +2829,7 @@
           WriteSet(Path, P.PropType{$IFNDEF CLR}^{$ENDIF}, TmpValue);
         end;
       end;
-    tkChar, tkInteger:
+    tkChar, tkWchar, tkInteger:
       begin
         if StorageOptions.StoreDefaultValues or not IsDefaultOrdProp(P) then
         begin
@@ -3156,17 +3180,13 @@
 function TJvCustomAppStorage.ReadWideString(const Path: string;
   const Default: WideString = ''): WideString;
 begin
-  {$IFDEF COMPILER12_UP}
-  Result := UTF8ToWideString(RawByteString(ReadString(Path, string(UTF8Encode(Default)))));
-  {$ELSE}
-  Result := UTF8Decode(ReadString(Path, UTF8Encode(Default)));
-  {$ENDIF COMPILER12_UP}
+  Result := DoReadWideString(Path,Default);
 end;
 
 procedure TJvCustomAppStorage.WriteWideString(const Path: string;
   const Value: WideString);
 begin
-  WriteString(Path, string(UTF8Encode(Value)));
+  DoWriteWideString(Path,Value);
 end;
 {$ENDIF COMPILER6_UP}
 
