зеркало из https://github.com/mozilla/pjs.git
Add a FinishNoBuff() method to the UnicodeToHZ encoder, to send the correct closing escape sequence
This commit is contained in:
Родитель
05222d6ea6
Коммит
ae28a37971
|
@ -133,6 +133,22 @@ NS_IMETHODIMP nsUnicodeToHZ::ConvertNoBuff(
|
|||
*aSrcLength = i;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsUnicodeToHZ::FinishNoBuff(char * aDest, PRInt32 * aDestLength)
|
||||
{
|
||||
if ( mHZState == HZ_STATE_GB )
|
||||
{
|
||||
// if we are in HZ mode, end it by adding a '~}' ESC sequence
|
||||
mHZState = HZ_STATE_ASCII;
|
||||
aDest[0] = '~';
|
||||
aDest[1] = '}';
|
||||
*aDestLength = 2;
|
||||
} else {
|
||||
*aDestLength = 0;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsUnicodeToHZ::FillInfo(PRUint32 *aInfo)
|
||||
{
|
||||
mUtil.FillGB2312Info(aInfo);
|
||||
|
|
|
@ -69,6 +69,8 @@ protected:
|
|||
char * aDest,
|
||||
PRInt32 * aDestLength);
|
||||
|
||||
NS_IMETHOD FinishNoBuff(char * aDest, PRInt32 * aDestLength);
|
||||
|
||||
NS_IMETHOD FillInfo(PRUint32 *aInfo);
|
||||
|
||||
NS_IMETHOD ConvertNoBuffNoErr(const PRUnichar * aSrc, PRInt32 * aSrcLength,
|
||||
|
|
Загрузка…
Ссылка в новой задаче