mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-26 23:34:44 +02:00
[BUG_FIXED]Fix the bug that Unicode path file opened in the previous session doesn't be restored.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@368 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
2b0cfc133f
commit
e11530f0c0
@ -92,7 +92,7 @@ void TiXmlBase::PutString( const TIXML_STRING& str, TIXML_STRING* outString )
|
|||||||
// Easy pass at non-alpha/numeric/symbol
|
// Easy pass at non-alpha/numeric/symbol
|
||||||
// 127 is the delete key. Below 32 is symbolic.
|
// 127 is the delete key. Below 32 is symbolic.
|
||||||
TCHAR buf[ 32 ];
|
TCHAR buf[ 32 ];
|
||||||
wsprintf( buf, TEXT("&#x%02X;"), (unsigned) ( c & 0xff ) );
|
wsprintf( buf, TEXT("&#x%04X;"), (unsigned) ( c & 0xffff ) );
|
||||||
outString->append( buf, lstrlen( buf ) );
|
outString->append( buf, lstrlen( buf ) );
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
@ -223,36 +223,20 @@ const TCHAR* TiXmlBase::ReadName( const TCHAR* p, TIXML_STRING * name )
|
|||||||
const TCHAR* TiXmlBase::GetEntity( const TCHAR* p, TCHAR* value )
|
const TCHAR* TiXmlBase::GetEntity( const TCHAR* p, TCHAR* value )
|
||||||
{
|
{
|
||||||
// Presume an entity, and pull it out.
|
// Presume an entity, and pull it out.
|
||||||
TIXML_STRING ent;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Handle the &#x entities.
|
// Handle the &#x entities.
|
||||||
if ( generic_strncmp( TEXT("&#x"), p, 3 ) == 0
|
if (generic_strncmp( TEXT("&#x"), p, 3 ) == 0)
|
||||||
&& *(p+3)
|
|
||||||
&& *(p+4)
|
|
||||||
&& ( *(p+4) == ';' || *(p+5) == ';' )
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
*value = 0;
|
const TCHAR* end = generic_strchr(p+3, TEXT(';'));
|
||||||
|
if (end && end - p <= 3 + 4)
|
||||||
if ( *(p+4) == ';' )
|
|
||||||
{
|
{
|
||||||
// Short, one value entity.
|
int val;
|
||||||
if ( isalpha( *(p+3) ) ) *value += ( tolower( *(p+3) ) - 'a' + 10 );
|
if (generic_sscanf(p+3, TEXT("%x"), &val) == 1)
|
||||||
else *value += ( *(p+3) - '0' );
|
|
||||||
|
|
||||||
return p+5;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// two value entity
|
*value = val;
|
||||||
if ( isalpha( *(p+3) ) ) *value += ( tolower( *(p+3) ) - 'a' + 10 ) * 16;
|
return end + 1;
|
||||||
else *value += ( *(p+3) - '0' ) * 16;
|
}
|
||||||
|
|
||||||
if ( isalpha( *(p+4) ) ) *value += ( tolower( *(p+4) ) - 'a' + 10 );
|
|
||||||
else *value += ( *(p+4) - '0' );
|
|
||||||
|
|
||||||
return p+6;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user