Skip to main content
Inspiring
August 7, 2008
Question

GetProfileString does not work with unicode?

  • August 7, 2008
  • 4 replies
  • 938 views
Hi,

I tried using GetProfileString from an ini file that is saved using unicode. My page is already in UTF-8 format. However, the function just returns empty string. When I tried to save the ini file using ANSI, the characters(which is Farsi) returned are just garbages. And when it is saved as unicode, it just returns an empty value. Any reasons why?
This topic has been closed for replies.

4 replies

dongzkyAuthor
Inspiring
August 8, 2008
yeah, great post. This is really a lot of help. Thanks Paul.
Inspiring
August 7, 2008
Daverms wrote:
>
quote:

When I tried to save the ini file using ANSI,

>
> I think you should save your ini file in ASCII format.

doesn't matter, the farsi will get garbaged with either encoding (or any that's
not unicode). you can't use cf's ini functions like resource bundles.
dongzkyAuthor
Inspiring
August 7, 2008
Hi Paul,

Can you give me an online documentation that talks about resource bundles? Thanks.
Inspiring
August 7, 2008
Great post Paul!...
Inspiring
August 7, 2008
quote:

When I tried to save the ini file using ANSI,


I think you should save your ini file in ASCII format.

Inspiring
August 7, 2008
dongzky wrote:
> I tried using GetProfileString from an ini file that is saved using unicode.

and now you know it doesn't work....use resource bundles.

> My page is already in UTF-8 format. However, the function just returns empty
> string. When I tried to save the ini file using ANSI, the characters(which is
> Farsi) returned are just garbages. And when it is saved as unicode, it just
> returns an empty value. Any reasons why?

why when you tried to save unicode as ANSI the data got garbaged? doesn't that
question already explain why your data got garbaged?

use resource bundles.