Roman Ryl...
2006-01-11 17:28:16 UTC
Hi,
This should be a simple issue however I did not find in newgroup
search. I have an FTP URL with embedded username, which in its turn
contains '@', something like:
'ftp://' <***@domain.com> ':' <password> '@' <server.com> </path...>
The problem is that InternetCreateUrl does not replace '@' character
with %40 and InternetCrackUrl subsequently fails. ICU_ENCODE flags does
not seem to make InternetCreateUrl convert the character, however if
the replacemed manually, InternetCrackUrl does decode correctly.
My question is whether there is a more correct solution than replace
'@' manually like I do now:
LPCTSTR pszUserName = ... ; // input
CString sUserNameEx;
if(_tcschr(pszUserName, _T('@')))
{
sUserNameEx = pszUserName;
sUserNameEx.Replace(_T("@"), _T("%40"));
pszUserName = sUserNameEx;
}
Roman
This should be a simple issue however I did not find in newgroup
search. I have an FTP URL with embedded username, which in its turn
contains '@', something like:
'ftp://' <***@domain.com> ':' <password> '@' <server.com> </path...>
The problem is that InternetCreateUrl does not replace '@' character
with %40 and InternetCrackUrl subsequently fails. ICU_ENCODE flags does
not seem to make InternetCreateUrl convert the character, however if
the replacemed manually, InternetCrackUrl does decode correctly.
My question is whether there is a more correct solution than replace
'@' manually like I do now:
LPCTSTR pszUserName = ... ; // input
CString sUserNameEx;
if(_tcschr(pszUserName, _T('@')))
{
sUserNameEx = pszUserName;
sUserNameEx.Replace(_T("@"), _T("%40"));
pszUserName = sUserNameEx;
}
Roman