Commit 37641596 authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix moaar utf8 rendering issues

parent 57b3ee3b
...@@ -473,7 +473,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf, ...@@ -473,7 +473,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
NSString *currentPreset = nil; NSString *currentPreset = nil;
if (p_aout) { if (p_aout) {
char *psz_preset_string = var_GetNonEmptyString(p_aout, "equalizer-preset"); char *psz_preset_string = var_GetNonEmptyString(p_aout, "equalizer-preset");
currentPreset = [NSString stringWithFormat:@"%s", psz_preset_string]; currentPreset = toNSStr(psz_preset_string);
free(psz_preset_string); free(psz_preset_string);
vlc_object_release(p_aout); vlc_object_release(p_aout);
} }
......
...@@ -572,7 +572,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -572,7 +572,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
if (p_item) { if (p_item) {
if (p_item->p_input) { if (p_item->p_input) {
if (p_item->p_input->psz_uri != nil) { if (p_item->p_input->psz_uri != nil) {
[self setMRL: [NSString stringWithFormat:@"%s", p_item->p_input->psz_uri]]; [self setMRL: toNSStr(p_item->p_input->psz_uri)];
[self updateDropView]; [self updateDropView];
[self updateOKButton]; [self updateOKButton];
......
...@@ -801,7 +801,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -801,7 +801,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSMenuItem * o_mi_tmp; NSMenuItem * o_mi_tmp;
for (NSUInteger x = 0; x < n; x++) { for (NSUInteger x = 0; x < n; x++) {
o_mi_tmp = [o_mu_device addItemWithTitle:[NSString stringWithFormat:@"%s", names[x]] action:@selector(toggleAudioDevice:) keyEquivalent:@""]; o_mi_tmp = [o_mu_device addItemWithTitle:toNSStr(names[x]) action:@selector(toggleAudioDevice:) keyEquivalent:@""];
[o_mi_tmp setTarget:self]; [o_mi_tmp setTarget:self];
[o_mi_tmp setTag:[[NSString stringWithFormat:@"%s", ids[x]] intValue]]; [o_mi_tmp setTag:[[NSString stringWithFormat:@"%s", ids[x]] intValue]];
} }
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#define B64DecNSStr(s) [[VLCStringUtility sharedInstance] b64Decode: s] #define B64DecNSStr(s) [[VLCStringUtility sharedInstance] b64Decode: s]
#define B64EncAndFree(s) [[VLCStringUtility sharedInstance] b64EncodeAndFree: s] #define B64EncAndFree(s) [[VLCStringUtility sharedInstance] b64EncodeAndFree: s]
inline NSString *toNSStr(const char *str) {
return str != NULL ? [NSString stringWithUTF8String:str] : @"";
}
unsigned int CocoaKeyToVLC(unichar i_key); unsigned int CocoaKeyToVLC(unichar i_key);
......
...@@ -181,7 +181,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -181,7 +181,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
return; return;
} }
[o_edit_fld_name setStringValue: [NSString stringWithFormat:@"%s", pp_bookmarks[row]->psz_name]]; [o_edit_fld_name setStringValue: toNSStr(pp_bookmarks[row]->psz_name)];
int total = pp_bookmarks[row]->i_time_offset/ 1000000; int total = pp_bookmarks[row]->i_time_offset/ 1000000;
int hour = total / (60*60); int hour = total / (60*60);
int min = (total - hour*60*60) / 60; int min = (total - hour*60*60) / 60;
...@@ -306,7 +306,7 @@ clear: ...@@ -306,7 +306,7 @@ clear:
} }
char *psz_uri = input_item_GetURI(input_GetItem(p_input)); char *psz_uri = input_item_GetURI(input_GetItem(p_input));
[[[VLCMain sharedInstance] wizard] initWithExtractValuesFrom: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_first]->i_time_offset/1000000] to: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_second]->i_time_offset/1000000] ofItem: [NSString stringWithFormat:@"%s", psz_uri]]; [[[VLCMain sharedInstance] wizard] initWithExtractValuesFrom: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_first]->i_time_offset/1000000] to: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_second]->i_time_offset/1000000] ofItem: toNSStr(psz_uri)];
free(psz_uri); free(psz_uri);
vlc_object_release(p_input); vlc_object_release(p_input);
...@@ -395,7 +395,7 @@ clear: ...@@ -395,7 +395,7 @@ clear:
else { else {
NSString * identifier = [theTableColumn identifier]; NSString * identifier = [theTableColumn identifier];
if ([identifier isEqualToString: @"description"]) if ([identifier isEqualToString: @"description"])
ret = [NSString stringWithFormat:@"%s", pp_bookmarks[row]->psz_name]; ret = toNSStr(pp_bookmarks[row]->psz_name);
else if ([identifier isEqualToString: @"size_offset"]) else if ([identifier isEqualToString: @"size_offset"])
ret = [NSString stringWithFormat:@"%lli", pp_bookmarks[row]->i_byte_offset]; ret = [NSString stringWithFormat:@"%lli", pp_bookmarks[row]->i_byte_offset];
else if ([identifier isEqualToString: @"time_offset"]) { else if ([identifier isEqualToString: @"time_offset"]) {
......
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
/* for the icon in our custom error panel */ /* for the icon in our custom error panel */
#import <ApplicationServices/ApplicationServices.h> #import <ApplicationServices/ApplicationServices.h>
NSString *toNSStr(const char *str) {
return str != NULL ? [NSString stringWithUTF8String:str] : @"";
}
/***************************************************************************** /*****************************************************************************
* VLCCoreDialogProvider implementation * VLCCoreDialogProvider implementation
*****************************************************************************/ *****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment