Skip to main content
pyae phyoe shein
Known Participant
December 3, 2009
Question

GetProfileString doesn't support unicode format.??

  • December 3, 2009
  • 1 reply
  • 1707 views

<!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

This topic has been closed for replies.

1 reply

Inspiring
December 3, 2009

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

pyae phyoe shein
Known Participant
December 4, 2009

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

Inspiring
December 4, 2009

no.