Hi Bob.
Thanks for the answer.
> I realize that this must be a report from a client, on a machine
where you do not have access to
That's right. I don't have access to his machine so I don't know yet
where the error is.
This is why I want to create a new account on my machine using UNICODE
characters.
There are 10000 ways for your program, that's running like a ballerina
in your computer, to crush like a hammer in user's computer.
I suppose that the path to the INI file is invalid because of those
'????' signs it returns.
So, my program can't read/write the INI file(s).
I get the path for 'App Data' using the GetSpecialFolder which I suppose
is able to return UNICODE strings. The problem is that Delphi does not
support very well UNICODE.
So I don't know if it worth to rewrite large pieces of my program to
support UNICODE.
If the problem will appear only when writing the INI files, then will be
simple because I can get rid of those INI files and write to registry
(Local_User).
But I want also to write text files (lists and databases). It won't be
nice to stick all that information in user's registry (in most cases I
don't have to write uninstallers for my applications because I leave no
traces behind me).
Under Win98 I never had problems because I put that information right in
the application's folder.
But now WinXP wants me to use user's profile (the 'App Data' folder),
which may contain UNICODE chars (God knows what they may put in it later).
Is this a dead end?
function GetAppDataFolder(AppName: string): string;
begin
if (OS_WinPlatform<>
VER_PLATFORM_WIN32_NT) {
GetWindowsPlatform >= Win2000 }
OR
UserHasAdminRights
{ Daca userul are drepturi de administrator atunci prefer sa scriu in
directorul aplicatiei }
then Result:= ExtractFilePath(Application.ExeName)
else Result:= GetSpecialFolder(CSIDL_APPDATA)+
AppName;
if NOT DirectoryExists(Result)
then ForceDirectories(Result);
end;
Bob Swart wrote:
> Hi CubicDesign,
>
>
>> I have problems reading/writing INI and TXT files under the 'Application
>> Data' folder when the user's account name contains UNICODE characters:
>>
>
> Under Windows Vista, but not under - say - Windows XP, right?
>
> What are the problems exactly? Do you get access violations, or just
> empty data when reading back from the .ini files? Or is it related to
> permission issues?
>
> Does it only happen with Delphi applications? (I realise that this must
> be a report from a client, on a machine where you do not have access to,
> but the answers might help to find out the nature of the problem).
>
>
>> How can I create a user account (under Win XP or Vista) that contains
>> these UNICODE characters - for testing purposes? I don't have a
>> Chinese/Russian keyboard (whatever this means).
>>
>
> The first step is to install the relevant language packs of Windows (I
> did that some time ago for Japanese, Simplified Chinese and Russian).
> You can verify if this has worked by searching the internet for some
> chinese or russian text, which will not display correctly without these
> components installed.
> This also means you can now read e-mail messages with those UNICODE
> characters (at least I can), so you can then as your clients to send
> some example user account strings (or copy some random text from the
> internet pages that you found to verify that you can display UNICODE
> characters in the first place).
>
>
>> My language (Romanian) has some non-english characters, but all of them
>> are available in the standard ASCI set. So I never used UNICODE until now.
>>
>
> I have some Chinese words that you could use in your tests...
>
> [Chinese Simplified]
> Europe=??
> Software=??
> Internet=???
>
> (I hope I got these right, but at least they're UNICODE characters ;-))
>
> Groetjes,
> Bob Swart
>
>
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi