зеркало из https://github.com/mozilla/pjs.git
1. change to UTF-16BE/LE name, 2. fix problem in nsPSMDetector 3.add addtional debugging infor to DetectCharset
This commit is contained in:
Родитель
2655b10bb5
Коммит
257b693f86
|
@ -187,8 +187,8 @@ PRBool nsPSMDetector::HandleData(const char* aBuf, PRUint32 aLen)
|
|||
);
|
||||
#endif
|
||||
Report( mVerifier[mItemIdx[j]]->charset);
|
||||
mDone = mDone;
|
||||
return PR_TRUE;
|
||||
mDone = PR_TRUE;
|
||||
return mDone;
|
||||
} else if (eError == st)
|
||||
{
|
||||
#ifdef DETECTOR_DEBUG
|
||||
|
|
|
@ -71,7 +71,7 @@ PCK4BITS( 6, 6, 6, 6,eError,eError,eStart,eStart) //30-37
|
|||
|
||||
|
||||
static nsVerifier nsUCS2BEVerifier = {
|
||||
"ISO-10646-UCS-2",
|
||||
"UTF-16BE",
|
||||
{
|
||||
eIdxSft4bits,
|
||||
eSftMsk4bits,
|
||||
|
|
|
@ -71,7 +71,7 @@ PCK4BITS( 5, 5, 5,eError, 5,eError,eStart,eStart) //30-37
|
|||
|
||||
|
||||
static nsVerifier nsUCS2LEVerifier = {
|
||||
"ISO-10646-UCS-2-LE",
|
||||
"UTF-16LE",
|
||||
{
|
||||
eIdxSft4bits,
|
||||
eSftMsk4bits,
|
||||
|
|
|
@ -337,7 +337,9 @@ int main(int argc, char** argv) {
|
|||
sz = read(0, buf, bs);
|
||||
if(sz > 0) {
|
||||
if(! done) {
|
||||
printf("call DoIt %d\n",sz);
|
||||
rev = det->DoIt( buf, sz, &done);
|
||||
printf("DoIt return Done = %d\n",done);
|
||||
if(NS_FAILED(rev))
|
||||
{
|
||||
printf("XPCOM ERROR CODE = %x\n", rev);
|
||||
|
@ -351,6 +353,8 @@ int main(int argc, char** argv) {
|
|||
} while(sz > 0);
|
||||
if(!done)
|
||||
{
|
||||
printf("Done = %d\n",done);
|
||||
printf("call Done %d\n",sz);
|
||||
rev = det->Done();
|
||||
if(NS_FAILED(rev))
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ package genverifier;
|
|||
);
|
||||
|
||||
|
||||
$ucs2be_ver = genverifier::GenVerifier("UCS2BE", "ISO-10646-UCS-2",
|
||||
$ucs2be_ver = genverifier::GenVerifier("UCS2BE", "UTF-16BE",
|
||||
\@ucs2be_cls, 6, \@ucs2be_st);
|
||||
print $ucs2be_ver;
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ package genverifier;
|
|||
);
|
||||
|
||||
|
||||
$ucs2le_ver = genverifier::GenVerifier("UCS2LE", "ISO-10646-UCS-2-LE", \@ucs2le_cls,
|
||||
$ucs2le_ver = genverifier::GenVerifier("UCS2LE", "UTF-16LE", \@ucs2le_cls,
|
||||
6, \@ucs2le_st);
|
||||
print $ucs2le_ver;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче