Re: How to convert const std::filesystem::directory_entry to tchar?
Nice, it works. Maybe it's possible to put "Space" between?
Re: How to convert const std::filesystem::directory_entry to tchar?
Yes. if you want a separator, just replace ""s with "separator"s eg " "s
Re: How to convert const std::filesystem::directory_entry to tchar?
Weird. Seems I tried it before but probably I did something else.
Edited: remebered that I tried this "' '"s.
Re: How to convert const std::filesystem::directory_entry to tchar?
It doesn't work on the other email. I'm getting weird symbols again and everytime I try, they are different. Do you know why it could be?
Re: How to convert const std::filesystem::directory_entry to tchar?
Quote:
Originally Posted by
prako2
It doesn't work on the other email. I'm getting weird symbols again and everytime I try, they are different. Do you know why it could be?
Could you post your actual code?
Re: How to convert const std::filesystem::directory_entry to tchar?
const string s3 = region + " "s + regionName;
printf("%s\n", s3.c_str());
email.put_Subject(s3.c_str());
Re: How to convert const std::filesystem::directory_entry to tchar?
Quote:
Originally Posted by
prako2
const string s3 = region + " "s + regionName;
printf("%s\n", s3.c_str());
email.put_Subject(s3.c_str());
Where and how are these region and regionName defined/initialized?
Did you debug your code? are the values of these variables correct (the same that were by initialization)?
Did you try something like
Code:
string s3 = region;
s3 += " ";
s3 += regionName;
instead?
Re: How to convert const std::filesystem::directory_entry to tchar?
Code:
region = json.stringOf("region");
regionName = json.stringOf("regionName");
What are the contents of region & regionName after the assignment here? Are they null-terminated c-style strings?
Re: How to convert const std::filesystem::directory_entry to tchar?
Instead of "Respublic of Lithuania (next pointer)78.63.209.141" I'm getting xnŪ 78.63.209.141 or ΓΈąį 78.63.209.141. It works well in Gmail but not in Yandex.
Re: How to convert const std::filesystem::directory_entry to tchar?
When issues arise dealing with c-style strings, It is often useful to see the actual contents of the memory used in both hex and char display. Something like this:
Code:
void display(const char* str)
{
for (auto s = str; *s; ++s)
printf("%hhx ", *s);
for (auto s = str; *s; ++s)
printf("%c ", *s);
puts("");
}
int main()
{
const char* cc1 = "my";
const char* cc2 = "name";
const string s3 = cc1 + ""s + cc2;
display(cc1);
display(cc2);
display(s3.c_str());
printf("%s\n", s3.c_str());
return 0;
}
which displays:
Code:
6d 79 m y
6e 61 6d 65 n a m e
6d 79 6e 61 6d 65 m y n a m e
myname
then if there seems to be a problem, you can see what is the underlying data.
So in your code, I suggest before the .put_Subject():
Code:
display(region);
display(regionName);
display(s3.c_str());
If this doesn't display as expected, then you know in which variable the error lies. if this all displays as expected, then the issue is with .putSubject().
PS Are you compiling as Unicode or Multi Byte Character Set? If Multi Byte, what encoding are you using - ASCII, utf-8, utf-16 etc?
Re: How to convert const std::filesystem::directory_entry to tchar?
Re: How to convert const std::filesystem::directory_entry to tchar?
Quote:
Originally Posted by
prako2
I use "Not set"
Well, i respect your "shortness", however it would be much better if you at least mentioned on what post you respond. :rolleyes: :cool:
FYI: Before you post....
Re: How to convert const std::filesystem::directory_entry to tchar?
I suspect this is the answer to the PS in post #40, and means that the Character Set property for the project is 'Not Set'. In which case I suggest changing it to 'Multi-byte character set' - and also saying what is the output from using the display() functions as also suggested in post #40.
Re: How to convert const std::filesystem::directory_entry to tchar?
VictorN, I'm sorry for being rude. 2kaud Thanks for helpful tips but I changed my code and I'm not able to test it.
Re: How to convert const std::filesystem::directory_entry to tchar?
Quote:
Originally Posted by
prako2
VictorN, I'm sorry for being rude. 2kaud Thanks for helpful tips but I changed my code and I'm not able to test it.
Better late than never... :)