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 » U++ Library support » FileSel&FileList, Path » Codepage problem in FileSel directory selection droplist
Codepage problem in FileSel directory selection droplist [message #23251] Mon, 05 October 2009 12:28 Go to next message
Tom1
Messages: 612
Registered: March 2007
Contributor
Hi,

I encountered a strange problem with the directory selection droplist of the FileSel dialog: The first entry is the home directory and is filled with dir.Add(GetHomeDirectory());. In the directory name a character '' gets replaced by another character (German double S) when the application executable is started stand-alone, but when started with Ctrl+F5 from TheIDE, there is no problem.

To figure out what's going on, I changed the GetHomeDirectory functionality in App.cpp by changing GetEnv() as follows:

String GetEnv(const char *id)
{
//	return FromOEMCharset(getenv(id));
	return FromSystemCharset(getenv(id));
}


What happened was, the character '' disappeared altogether when running the application from TheIDE, but was now correctly presented when the application was started as standalone.

Any idea what's going on here?

// Tom

[UPDATE: This is under Windows Vista x64 and the problem when running the application standalone was detected with 32 bit Windows XP, so they seem to have the same behavior.]

[Updated on: Mon, 05 October 2009 12:32]

Report message to a moderator

Re: Codepage problem in FileSel directory selection droplist [message #23253 is a reply to message #23251] Mon, 05 October 2009 13:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11825
Registered: November 2005
Ultimate Member
Tom1 wrote on Mon, 05 October 2009 06:28

Hi,

I encountered a strange problem with the directory selection droplist of the FileSel dialog: The first entry is the home directory and is filled with dir.Add(GetHomeDirectory());. In the directory name a character '' gets replaced by another character (German double S) when the application executable is started stand-alone, but when started with Ctrl+F5 from TheIDE, there is no problem.

To figure out what's going on, I changed the GetHomeDirectory functionality in App.cpp by changing GetEnv() as follows:

String GetEnv(const char *id)
{
//	return FromOEMCharset(getenv(id));
	return FromSystemCharset(getenv(id));
}


What happened was, the character '' disappeared altogether when running the application from TheIDE, but was now correctly presented when the application was started as standalone.

Any idea what's going on here?

// Tom

[UPDATE: This is under Windows Vista x64 and the problem when running the application standalone was detected with 32 bit Windows XP, so they seem to have the same behavior.]


Nice one.

I believe I know what is going on.

The issue is that TheIDE changes the environment to add one special variable. Maybe this can affect the issue.

Anyway, staring into the code, I do not see anything indicating that codepage is changed on the way - in fact no conversions seem to be performed at all.

Relevant code is:

Core\App.cpp
void AppInitEnvironment__()

ide\Builders\Build.cpp

One<Host> MakeBuild::CreateHost(bool sync_files)

Perhaps adding a couple of well placed LOGs would reveal the problem.

Mirek
Re: Codepage problem in FileSel directory selection droplist [message #23264 is a reply to message #23253] Tue, 06 October 2009 11:06 Go to previous messageGo to next message
Tom1
Messages: 612
Registered: March 2007
Contributor
Hi Mirek,

Well, I kind of knew you would know what is going on... Anyway, I took a look at the source locations you pointed out but I did not get any smarter on the way. I guess this needs deeper understanding on the subject than what I have.

I gather that this problem has wider effects than just the file dialog. The whole GetEnv and everything using it (including GetHomeDirectory) are broken until this gets solved.

// Tom
Re: Codepage problem in FileSel directory selection droplist [message #23285 is a reply to message #23264] Wed, 07 October 2009 11:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11825
Registered: November 2005
Ultimate Member
Tom1 wrote on Tue, 06 October 2009 05:06

Hi Mirek,

Well, I kind of knew you would know what is going on... Anyway, I took a look at the source locations you pointed out but I did not get any smarter on the way. I guess this needs deeper understanding on the subject than what I have.

I gather that this problem has wider effects than just the file dialog. The whole GetEnv and everything using it (including GetHomeDirectory) are broken until this gets solved.

// Tom


Well, I hoped I will not have to create non-ASCII user on my machine Smile

Mirek
Re: Codepage problem in FileSel directory selection droplist [message #23323 is a reply to message #23285] Fri, 09 October 2009 14:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11825
Registered: November 2005
Ultimate Member
Should be fixed now.

Mirek
Re: Codepage problem in FileSel directory selection droplist [message #23343 is a reply to message #23323] Mon, 12 October 2009 11:23 Go to previous message
Tom1
Messages: 612
Registered: March 2007
Contributor
Hi Mirek,

Thank you! It works now correctly.

Best regards,

Tom
Previous Topic: A little improvement to AppendFileName
Next Topic: FileSel::ExecuteSaveAs() crashes
Goto Forum:
  


Current Time: Fri Apr 19 12:57:10 CEST 2019

Total time taken to generate the page: 0.00898 seconds