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

GetProfileString doesn't support unicode format.??

Community Beginner ,
Dec 03, 2009 Dec 03, 2009

Copy link to clipboard

Copied

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>Untitled</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>

<cfset currentPath = getCurrentTemplatePath()>
<cfset currentDirectory = getDirectoryFromPath(currentPath)>

<cfscript>

function udf_Translate(Name, Filename, Section) {
    var outText="";

    //    If user selected default language (English), bypass the translation
    if (cookie.cookie_language eq "EN")
        return Name;
    if (Filename eq "")
        Filename = "Common";
    if (Section eq "")
        Section = "Common";
       
    INI_Path = #currentDirectory# & "Language.properties";
       
    outText = GetProfileString(INI_Path, Section, Name);
    
   
  return IIf(Len(Trim(outText)) gt 0, DE(outText), DE(Name));
   
}
</cfscript>

<cfoutput>#udf_translate("Ward", "Inpatient", "")#</cfoutput>

</body>
</html>

Language.properties

[COMMON]
Ward=Phường

It output only "Ward" instead of Phường when I save this file as UFT-8. But, when I save this file as ANSI encoding, it output as Phu?ng. It's wrong. Why GetProfileString doesn't UTF-8 format? Any solutions will be appreciated.Untitl

TOPICS
Advanced techniques

Views

1.2K

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
Enthusiast ,
Dec 03, 2009 Dec 03, 2009

Copy link to clipboard

Copied

no it doesn't support unicode. and probably not a good idea to use it for

resource bundle (RB) substitute, use real RB instead.

http://www.sustainablegis.com/unicode/resourceBundle/rb.cfm

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
Community Beginner ,
Dec 03, 2009 Dec 03, 2009

Copy link to clipboard

Copied

Thanks, it's cool. But, is there any others solution for reading unicode format in Language.properties with GetProfileString?

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
Enthusiast ,
Dec 03, 2009 Dec 03, 2009

Copy link to clipboard

Copied

no.

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
Community Beginner ,
Dec 03, 2009 Dec 03, 2009

Copy link to clipboard

Copied

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
Enthusiast ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

no, i believe that's called re-inventing the wheel.

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
Community Beginner ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

ha ha... you can say that again. But, I can do it by myself.

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
Enthusiast ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

you didn't need to (that's why it's called "re-inventing the wheel"):

http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=cat&catid=6D990B76-50FC-543B-1FA4AB2B1CE26EFC

once these things get bigger & more complex, how will you manage them? notepad?

you're better off sticking w/a "main stream"/proven methodology that are based

on good practices than knocking off stuff like this.

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
Community Beginner ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

ahh.. nope, thanks anyway. Because, we use "getprofilestring" for internationalize in our project. In our projects, there are more than 500 files. Now, our client is Vietnamense and their language is created by unicode. As you know, getprofilestring doesn't support unicode. That's why I create it above coding, and don't wanna touch all files in our projects for this language. If we use above link you show, we need to replace all files.

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
Enthusiast ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

what you're doing is a perfect example of a bad practice. i guess that you

didn't bother researching this before you started. suit yourself.

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
Community Beginner ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

Sure, dude. Because, we're on rush. Thanks, anyway.


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
Community Expert ,
Dec 04, 2009 Dec 04, 2009

Copy link to clipboard

Copied

LATEST

This exchange is quite familiar. It occurs daily at our own neck of the woods. What fun!

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