Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 05, 2010 platformstl::path on MinGW on Windows - uses Unicode | ||||
---|---|---|---|---|
| ||||
Hi, I'm using platformstl::path on MinGW on Windows (via the Qt Creator IDE). It redirects to using winstl::path. However, it seems to define path to use wide-char/Unicode encoding by default (for the file names for example). How can I change this default? As a workaround I changed to explicitly using winstl::path_a, but this is not portable to Unix/Linux. Please advise, Thanks, Adi |
November 05, 2010 Re: platformstl::path on MinGW on Windows - uses Unicode | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adi Shavit | IIRC it defines winstl::path as winstl::basic_path<TCHAR>, so it depends on the defin. of UNICODE. Checking now ... yes, that's right. typedef basic_path<TCHAR, filesystem_traits<TCHAR> > path; unixstl::path is defined as char, since the definition of UNICODE is not a done practice on UNIX. (Or if it is, that's a new one on me.) I recognise that this is a little odd, but it was the best choice I could come up with. Have an open ear to other ideas ... "Adi Shavit" <adishavit_thisDoesNotBelongHere_@gmail.com> wrote in message news:ib1o23$h5$1@digitalmars.com... > Hi, > > I'm using platformstl::path on MinGW on Windows (via the Qt Creator IDE). > It redirects to using winstl::path. However, it seems to define path to > use wide-char/Unicode encoding by default (for the file names for > example). > > How can I change this default? > > As a workaround I changed to explicitly using winstl::path_a, but this is not portable to Unix/Linux. > > Please advise, > Thanks, > Adi > |
November 08, 2010 Re: platformstl::path on MinGW on Windows - uses Unicode | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matt Wilson | So let me see if I get you correctly: 1. I want to use platformstl (and not winstl) for portability (to Linux). 2. I want to always work with chars 3. There seems to be no platformstl::path_a I ended up doing this: #ifdef UNICODE #undef UNICODE #include "3rdParty/stlsoft-1.9.101/include/platformstl/filesystem/path.hpp" #define UNICODE #endif and use platformstl::path Is this the right approach? Suggestion: If platformstl::path_a was available it would have been simpler... Thanks, Adi Matt Wilson Wrote: > IIRC it defines winstl::path as winstl::basic_path<TCHAR>, so it depends on the defin. of UNICODE. > > Checking now ... yes, that's right. > > typedef basic_path<TCHAR, filesystem_traits<TCHAR> > path; > > unixstl::path is defined as char, since the definition of UNICODE is not a done practice on UNIX. (Or if it is, that's a new one on me.) > > I recognise that this is a little odd, but it was the best choice I could come up with. Have an open ear to other ideas ... > > > "Adi Shavit" <adishavit_thisDoesNotBelongHere_@gmail.com> wrote in message news:ib1o23$h5$1@digitalmars.com... > > Hi, > > > > I'm using platformstl::path on MinGW on Windows (via the Qt Creator IDE). > > It redirects to using winstl::path. However, it seems to define path to > > use wide-char/Unicode encoding by default (for the file names for > > example). > > > > How can I change this default? > > > > As a workaround I changed to explicitly using winstl::path_a, but this is not portable to Unix/Linux. > > > > Please advise, > > Thanks, > > Adi > > > > |
November 08, 2010 Re: platformstl::path on MinGW on Windows - uses Unicode | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adi Shavit | Adi Shavit Wrote:
> So let me see if I get you correctly:
>
> 1. I want to use platformstl (and not winstl) for portability (to Linux).
> 2. I want to always work with chars
> 3. There seems to be no platformstl::path_a
>
> I ended up doing this:
>
> #ifdef UNICODE
> #undef UNICODE
> #include "3rdParty/stlsoft-1.9.101/include/platformstl/filesystem/path.hpp"
> #define UNICODE
> #endif
>
> and use platformstl::path
>
> Is this the right approach?
>
> Suggestion: If platformstl::path_a was available it would have been simpler...
Yuck! That's not good.
Point taken.
|
November 22, 2010 Re: platformstl::path on MinGW on Windows - uses Unicode | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adi Shavit | This is now done as you suggest. Matt "Adi Shavit" <adishavit_thisDoesNotBelongHere_@gmail.com> wrote in message news:ib9n4e$2m6l$1@digitalmars.com... > So let me see if I get you correctly: > > 1. I want to use platformstl (and not winstl) for portability (to Linux). > 2. I want to always work with chars > 3. There seems to be no platformstl::path_a > > I ended up doing this: > > #ifdef UNICODE > #undef UNICODE > #include > "3rdParty/stlsoft-1.9.101/include/platformstl/filesystem/path.hpp" > #define UNICODE > #endif > > and use platformstl::path > > Is this the right approach? > > Suggestion: If platformstl::path_a was available it would have been simpler... > > Thanks, > Adi > > Matt Wilson Wrote: > >> IIRC it defines winstl::path as winstl::basic_path<TCHAR>, so it depends >> on >> the defin. of UNICODE. >> >> Checking now ... yes, that's right. >> >> typedef basic_path<TCHAR, filesystem_traits<TCHAR> > path; >> >> unixstl::path is defined as char, since the definition of UNICODE is not >> a >> done practice on UNIX. (Or if it is, that's a new one on me.) >> >> I recognise that this is a little odd, but it was the best choice I could come up with. Have an open ear to other ideas ... >> >> >> "Adi Shavit" <adishavit_thisDoesNotBelongHere_@gmail.com> wrote in >> message >> news:ib1o23$h5$1@digitalmars.com... >> > Hi, >> > >> > I'm using platformstl::path on MinGW on Windows (via the Qt Creator >> > IDE). >> > It redirects to using winstl::path. However, it seems to define path to >> > use wide-char/Unicode encoding by default (for the file names for >> > example). >> > >> > How can I change this default? >> > >> > As a workaround I changed to explicitly using winstl::path_a, but this >> > is >> > not portable to Unix/Linux. >> > >> > Please advise, >> > Thanks, >> > Adi >> > >> >> > |
Copyright © 1999-2021 by the D Language Foundation