Commit eac6a8ea authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

subsdec: remove broken AppendWideChar()

That function assumed that:
- wchar_t and wint_t are the same: not true on Linux-i386,
- the locale encodes characters as UTF-8: not true on Windows.

This replaces its only occurrence with AppendString() and an explicit
UTF-8 sequence.
parent 9719d3be
......@@ -477,16 +477,6 @@ static bool AppendCharacter( text_segment_t* p_segment, char c )
return true;
}
static bool AppendWideCharacter( text_segment_t* p_segment, wchar_t c )
{
char* tmp;
if ( asprintf( &tmp, "%s%lc", p_segment->psz_text ? p_segment->psz_text : "", c ) < 0 )
return false;
free( p_segment->psz_text );
p_segment->psz_text = tmp;
return true;
}
static bool AppendString( text_segment_t* p_segment, const char* psz_str )
{
char* tmp;
......@@ -1025,7 +1015,7 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
}
else if( !strncasecmp( psz_subtitle, "\\h", 2 ) )
{
if ( !AppendWideCharacter( p_segment, L'\u00A0' ) )
if ( !AppendString( p_segment, "\xC2\xA0" ) )
goto fail;
psz_subtitle += 2;
}
......
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