[vlc-commits] macosx: fixed correct display of UTF8 strings within the Extension dialogs (fixes #5848)

Felix Paul Kühne git at videolan.org
Sun Jan 15 18:58:00 CET 2012


vlc/vlc-1.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jan 15 16:16:20 2012 +0100| [5cf9fd70177328c273ff86b608d2b6f99f066cac] | committer: Jean-Baptiste Kempf

macosx: fixed correct display of UTF8 strings within the Extension dialogs (fixes #5848)
(cherry picked from commit 6afece092f9fcba610c43f3331a99f646caaebfa)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=5cf9fd70177328c273ff86b608d2b6f99f066cac
---

 modules/gui/macosx/ExtensionsDialogProvider.m      |    8 ++++----
 modules/gui/macosx/ExtensionsManager.m             |    4 ++--
 .../gui/macosx_dialog_provider/dialogProvider.m    |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/ExtensionsDialogProvider.m b/modules/gui/macosx/ExtensionsDialogProvider.m
index 37a1e4e..6cb5ed7 100644
--- a/modules/gui/macosx/ExtensionsDialogProvider.m
+++ b/modules/gui/macosx/ExtensionsDialogProvider.m
@@ -154,7 +154,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
             assert([control isKindOfClass:[NSTextView class]]);
             NSTextView *textView = (NSTextView *)control;
             NSString *string = [NSString stringWithUTF8String:widget->psz_text];
-            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL];
+            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding: NSISOLatin1StringEncoding] documentAttributes:NULL];
             [[textView textStorage] setAttributedString:attrString];
             [textView setNeedsDisplay:YES];
             [textView scrollRangeToVisible:NSMakeRange(0, 0)];
@@ -170,8 +170,8 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
                 break;
             assert([control isKindOfClass:[NSControl class]]);
             NSControl *field = (NSControl *)control;
-            NSString *string = [NSString stringWithUTF8String:widget->psz_text];
-            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL];
+            NSString *string = [NSString stringWithCString:widget->psz_text encoding:NSUTF8StringEncoding];
+            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding: NSISOLatin1StringEncoding] documentAttributes:NULL];
             [field setAttributedStringValue:attrString];
             [attrString release];
             break;
@@ -552,7 +552,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil;
                     p_dialog->psz_title ) != 0 )
         {
             NSString *titleString = [NSString stringWithCString:p_dialog->psz_title 
-                                                       encoding:NSASCIIStringEncoding];
+                                                       encoding:NSUTF8StringEncoding];
 
             [dialogWindow setTitle:titleString];
         }
diff --git a/modules/gui/macosx/ExtensionsManager.m b/modules/gui/macosx/ExtensionsManager.m
index bb5be08..80e7551 100644
--- a/modules/gui/macosx/ExtensionsManager.m
+++ b/modules/gui/macosx/ExtensionsManager.m
@@ -93,7 +93,7 @@ static ExtensionsManager* instance = nil;
         bool b_Active = extension_IsActivated( p_extensions_manager, p_ext );
 
         NSString *titleString = [NSString stringWithCString:p_ext->psz_title 
-                                                   encoding:NSASCIIStringEncoding];
+                                                   encoding:NSUTF8StringEncoding];
 
         if( b_Active && extension_HasMenu( p_extensions_manager, p_ext ) )
         {
@@ -116,7 +116,7 @@ static ExtensionsManager* instance = nil;
                 {
                     ++i_num;
                     titleString = [NSString stringWithCString:ppsz_titles[i]
-                                                     encoding:NSASCIIStringEncoding];
+                                                     encoding:NSUTF8StringEncoding];
                     NSMenuItem *menuItem = [submenu addItemWithTitle:titleString
                                                               action:@selector(triggerMenu:)
                                                        keyEquivalent:@""];
diff --git a/modules/gui/macosx_dialog_provider/dialogProvider.m b/modules/gui/macosx_dialog_provider/dialogProvider.m
index 1605740..ed6af0e 100644
--- a/modules/gui/macosx_dialog_provider/dialogProvider.m
+++ b/modules/gui/macosx_dialog_provider/dialogProvider.m
@@ -675,7 +675,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
 //            assert([control isKindOfClass:[NSTextView class]]);
 //            NSTextView *textView = (NSTextView *)control;
 //            NSString *string = [NSString stringWithUTF8String:widget->psz_text];
-//            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL];
+//            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL];
 //            [[textView textStorage] setAttributedString:[[NSAttributedString alloc] initWithString:@"Hello"]];
 //            NSLog(@"%@", string);
 //            [textView setNeedsDisplay:YES];
@@ -688,7 +688,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
             assert([control isKindOfClass:[NSTextView class]]);
             NSTextView *textView = (NSTextView *)control;
             NSString *string = [NSString stringWithUTF8String:widget->psz_text];
-            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL];
+            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL];
             [[textView textStorage] setAttributedString:attrString];
             [textView setNeedsDisplay:YES];
             [textView scrollRangeToVisible:NSMakeRange(0, 0)];
@@ -705,7 +705,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
             assert([control isKindOfClass:[NSControl class]]);
             NSControl *field = (NSControl *)control;
             NSString *string = [NSString stringWithUTF8String:widget->psz_text];
-            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSUTF8StringEncoding] documentAttributes:NULL];
+            NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL];
             [field setAttributedStringValue:attrString];
             [attrString release];
             break;



More information about the vlc-commits mailing list