Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » More Unicode questions
Re: More Unicode questions [message #21556 is a reply to message #21536] Tue, 26 May 2009 14:29 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1405
Registered: September 2007
Ultimate Contributor
And for GetEnv:
String GetEnv(const char *id)
{
#if defined(PLATFORM_WIN32)
	if (IsWinNT()) {
		WStringBuffer temp(32767);
		WString varname(id);
		int len = GetEnvironmentVariableW(varname, temp, 32766);
		temp.SetLength(len);
		WString value = temp;
		
		WString newval = GetWinRegStringW(varname, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", HKEY_LOCAL_MACHINE);
		if (!newval.IsVoid()) 
			value = newval;
			
		newval = GetWinRegStringW(varname, L"Environment", HKEY_CURRENT_USER);
		if (!newval.IsVoid()) 
			value = newval;
		
		return value.ToString();
	}
	else
		return FromSystemCharset(getenv(id));
#else
	return FromSystemCharset(getenv(id));
#endif
}

[Updated on: Thu, 28 May 2009 14:03]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Cross Compile HowTo?
Next Topic: Problem installing upp on ubuntu
Goto Forum:
  


Current Time: Sat Jun 15 23:25:34 CEST 2024

Total time taken to generate the page: 0.01791 seconds