Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions libclocale/libclocale_codepage.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,20 @@ int libclocale_codepage_copy_from_string(
}
}
}
else if( ( string_index + 8 ) == string_length )
{
if( ( string[ string_index ] == (wchar_t) '9' )
&& ( string[ string_index + 1 ] == (wchar_t) '4' )
&& ( string[ string_index + 2 ] == (wchar_t) '9' )
&& ( string[ string_index + 3 ] == (wchar_t) '-' )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add _ as a separator as well

&& ( string[ string_index + 4 ] == (wchar_t) '2' )
&& ( string[ string_index + 5 ] == (wchar_t) '0' )
&& ( string[ string_index + 6 ] == (wchar_t) '0' )
&& ( string[ string_index + 7 ] == (wchar_t) '0' ) )
{
*codepage = LIBCLOCALE_CODEPAGE_WINDOWS_949;
}
}
}
if( *codepage != -1 )
{
Expand Down Expand Up @@ -908,6 +922,20 @@ int libclocale_codepage_copy_from_string_wide(
}
}
}
else if( ( string_index + 8 ) == string_length )
{
if( ( string[ string_index ] == (wchar_t) '9' )
&& ( string[ string_index + 1 ] == (wchar_t) '4' )
&& ( string[ string_index + 2 ] == (wchar_t) '9' )
&& ( string[ string_index + 3 ] == (wchar_t) '-' )
&& ( string[ string_index + 4 ] == (wchar_t) '2' )
&& ( string[ string_index + 5 ] == (wchar_t) '0' )
&& ( string[ string_index + 6 ] == (wchar_t) '0' )
&& ( string[ string_index + 7 ] == (wchar_t) '0' ) )
{
*codepage = LIBCLOCALE_CODEPAGE_WINDOWS_949;
}
}
}
if( *codepage != -1 )
{
Expand Down
Loading