freebsd-ports/www/helixplugin/files/patch-unicode
Mikhail Teterin ef62575d24 Build the Helix/Real browser plugin as native FreeBSD shared library.
The pluging starts an external `realplay' executable anyway, so the
realplay can remain of Linux version, working cleanly with the FreeBSD
browsers.

Adobe is using the same method for Acrobat Reader, but does not publish
the plugin's source.
2007-03-19 21:33:38 +00:00

39 lines
1.5 KiB
Text

--- player/app/plugin/hxbackend.cpp Mon Mar 19 14:45:03 2007
+++ player/app/plugin/hxbackend.cpp Mon Mar 19 16:49:02 2007
@@ -72,4 +72,5 @@
#include <nsIComponentManager.h>
#include <nsIDOMWindow.h>
+#include <nsStringAPI.h>
#define EXIT_CODE_UNKNOWN 0
@@ -710,17 +702,13 @@
if(instance)
{
- PRUnichar *pUnicodeTitle = NULL;
- PRUnichar *pUnicodeMessage = NULL;
-
NPN_GetValue(instance, NPNVDOMWindow, &pDomWindow);
- if(m_pPromptService && m_pUConv && m_pMemory && pDomWindow)
- {
- m_pUConv->ConvertToUnicode("Helix DNA Plugin Error", &pUnicodeTitle);
- m_pUConv->ConvertToUnicode(szError, &pUnicodeMessage);
- }
-
- if(pUnicodeTitle && pUnicodeMessage && m_pPromptService && m_pMemory && pDomWindow)
+ if(m_pPromptService && m_pMemory && pDomWindow)
{
+ nsString UnicodeMessage, UnicodeTitle;
+
+ NS_CStringToUTF16(nsCString(szError), NS_CSTRING_ENCODING_ASCII, UnicodeMessage);
+ NS_CStringToUTF16(nsCString("Helix DNA Plugin Error"), NS_CSTRING_ENCODING_ASCII, UnicodeTitle);
+
/* Cancel the callback timer while the alert dialog is up to
prevent a race (eg, the timer callback can call Shutdown(),
@@ -730,5 +718,5 @@
StopCallbackTimer();
- m_pPromptService->Alert(pDomWindow, pUnicodeTitle, pUnicodeMessage);
+ m_pPromptService->Alert(pDomWindow, UnicodeTitle.get(), UnicodeMessage.get());
if(bRestartCallbackTimer)