#pragma hdrstop
#endif
+#ifndef WX_PRECOMP
+ #include "wx/crt.h"
+#endif
+
#include "wx/uri.h"
// ---------------------------------------------------------------------------
if (m_fields)
Clear();
- return Parse(uri);
+ // FIXME-UTF8: rewrite ParseXXX() methods using iterators
+ // NB: using wxWxCharBuffer instead of just c_str() avoids keeping
+ // converted string in memory for longer than needed
+ return Parse(wxWxCharBuffer(uri.c_str()));
}
// ---------------------------------------------------------------------------
// URI-reference = URI / relative
// ---------------------------------------------------------------------------
-const wxChar* wxURI::Parse(const wxChar* uri)
+const wxChar* wxURI::Parse(const wxChar *uri)
{
uri = ParseScheme(uri);
uri = ParseAuthority(uri);
// Individual parsers for each URI component
// ---------------------------------------------------------------------------
-const wxChar* wxURI::ParseScheme(const wxChar* uri)
+const wxChar* wxURI::ParseScheme(const wxChar *uri)
{
wxASSERT(uri != NULL);
if (bNormalize)
{
wxStringBufferLength theBuffer(m_path, m_path.length() + 1);
-#if wxUSE_STL
+#if wxUSE_STL || wxUSE_UNICODE_UTF8
+ // FIXME-UTF8: have some wxReadWriteStringBuffer instead?
wxTmemcpy(theBuffer, m_path.c_str(), m_path.length()+1);
#endif
Normalize(theBuffer, true);
if (bNormalize)
{
wxStringBufferLength theBuffer(m_path, m_path.length() + 1);
-#if wxUSE_STL
+#if wxUSE_STL || wxUSE_UNICODE_UTF8
+ // FIXME-UTF8: have some wxReadWriteStringBuffer instead?
wxTmemcpy(theBuffer, m_path.c_str(), m_path.length()+1);
#endif
Normalize(theBuffer);