nsTextToSubURI.h 926 B

12345678910111213141516171819202122232425262728293031
  1. // -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. // This Source Code is subject to the terms of the Mozilla Public License
  3. // version 2.0 (the "License"). You can obtain a copy of the License at
  4. // http://mozilla.org/MPL/2.0/.
  5. #ifndef nsTextToSubURI_h__
  6. #define nsTextToSubURI_h__
  7. #include "nsITextToSubURI.h"
  8. #include "nsString.h"
  9. #include "nsTArray.h"
  10. class nsTextToSubURI: public nsITextToSubURI
  11. {
  12. NS_DECL_ISUPPORTS
  13. NS_DECL_NSITEXTTOSUBURI
  14. private:
  15. virtual ~nsTextToSubURI();
  16. // We assume that the URI is encoded as UTF-8.
  17. nsresult convertURItoUnicode(const nsAFlatCString &aCharset,
  18. const nsAFlatCString &aURI,
  19. nsAString &_retval);
  20. // Characters from the pref "network.IDN.blacklist_chars", or a built-in
  21. // fallback if reading the pref fails.
  22. nsTArray<char16_t> mUnsafeChars;
  23. };
  24. #endif // nsTextToSubURI_h__