• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

GetProfileString does not work with unicode?

Participant ,
Aug 06, 2008 Aug 06, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

809

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 06, 2008 Aug 06, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 06, 2008 Aug 06, 2008

Copy link to clipboard

Copied

quote:

When I tried to save the ini file using ANSI,


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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 07, 2008 Aug 07, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2008 Aug 07, 2008

Copy link to clipboard

Copied

Hi Paul,

Can you give me an online documentation that talks about resource bundles? Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 07, 2008 Aug 07, 2008

Copy link to clipboard

Copied

Great post Paul!...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 07, 2008 Aug 07, 2008

Copy link to clipboard

Copied

dongzky wrote:
> Can you give me an online documentation that talks about resource bundles? Thanks.

http://www.adobe.com/devnet/coldfusion/articles/globalize.html
http://www.forta.com/books/0321515463/CFWACK8-2-EChapters.pdf (though buy the
books, excellent cf resource)
http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=cat&catid=6D990B76-50FC-543B-1FA4AB2B1CE26E...
http://www.sustainablegis.com/unicode/resourceBundle/javaRB.cfm


recent discussion on cf-talk about resource bundle editors:
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:57166
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:57167

btw we've been down this route too (thinking that ini files would do the trick
since cf doesn't have any resource bundle methods) but once stuff gets complex,
you'll really want a decent rb editor anyway. not to mention message formatting,
pluralization, etc. that real rb can help with.

use one flavor of the rb CFCs (rb in the classpath or non-classpath) & a decent
rb editor (icu4j's rbManager or attesoro's are the two best, java-based & free)
& you should be good to go.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2008 Aug 07, 2008

Copy link to clipboard

Copied

LATEST
yeah, great post. This is really a lot of help. Thanks Paul.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation