Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* Remove replace invalid chars operator in wstring_to_utf8 #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ActiveXCore/axstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void ActiveXStream::signalRequestCompleted(ActiveXStreamRequestPtr request, bool
signalCompleted( success );
close();
}
request->stop();
}

void ActiveXStream::signalCacheFilename(const std::wstring& cacheFilename)
Expand Down
4 changes: 3 additions & 1 deletion src/ActiveXCore/axstream_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ STDMETHODIMP ActiveXBindStatusCallback::OnProgress(ULONG ulProgress, ULONG ulPro
STDMETHODIMP
ActiveXBindStatusCallback::OnStopBinding(HRESULT hrStatus, LPCWSTR pszError)
{
if ( m_request->stream ) m_request->stream->signalRequestCompleted( m_request, !FAILED(hrStatus) );
ActiveXStreamPtr stream = m_request->stream;
if (stream)
stream->signalRequestCompleted(m_request, !FAILED(hrStatus));

if (m_pbinding)
{
Expand Down
10 changes: 4 additions & 6 deletions src/ScriptingCore/utf8_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ namespace FB {

std::string wstring_to_utf8(const std::wstring& src) {
std::string out_str;
std::wstring in_str;
utf8::replace_invalid(src.begin(), src.end(), std::back_inserter(in_str));
#ifdef _WIN32
utf8::utf16to8(in_str.begin(), in_str.end(), std::back_inserter(out_str));
#else
utf8::utf32to8(in_str.begin(), in_str.end(), std::back_inserter(out_str));
#ifdef _WIN32
utf8::utf16to8(src.begin(), src.end(), std::back_inserter(out_str));
#else
utf8::utf32to8(src.begin(), src.end(), std::back_inserter(out_str));
#endif
return out_str;
}
Expand Down