rtoss

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/GreenPad/ @ 130  →  /GreenPad/ @ 131
/GreenPad/OpenSaveDlg.cpp
@@ -26,11 +26,13 @@
TEXT("’†‘Œê(HZ)"),
TEXT("’†‘Œê(Big5)"),
TEXT("UTF-1"),
TEXT("UTF-1(BOM)"),
TEXT("UTF-5"),
TEXT("UTF-7"),
TEXT("UTF-8"),
TEXT("UTF-8N"),
TEXT("UTF-9(1997)"),
TEXT("UTF-9(1997,BOM)"),
TEXT("UTF-16BE(BOM)"),
TEXT("UTF-16LE(BOM)"),
TEXT("UTF-16BE"),
@@ -81,11 +83,13 @@
TEXT("Chinese(HZ)"),
TEXT("Chinese(Big5)"),
TEXT("UTF-1"),
TEXT("UTF-1(BOM)"),
TEXT("UTF-5"),
TEXT("UTF-7"),
TEXT("UTF-8"),
TEXT("UTF-8N"),
TEXT("UTF-9(1997)"),
TEXT("UTF-9(1997,BOM)"),
TEXT("UTF-16BE(BOM)"),
TEXT("UTF-16LE(BOM)"),
TEXT("UTF-16BE"),
@@ -136,11 +140,13 @@
TEXT("HZ"),
TEXT("BIG5"),
TEXT("UTF1"),
TEXT("UTF1"),
TEXT("UTF5"),
TEXT("UTF7"),
TEXT("UTF8"),
TEXT("UTF8"),
TEXT("UTF9"),
TEXT("UTF9"),
TEXT("U16B"),
TEXT("U16L"),
TEXT("U16B"),
@@ -206,48 +212,50 @@
Enroll( IsoCN, 8 ),
Enroll( HZ , 9 );
if( ::IsValidCodePage(950) ) Enroll( Big5 , 10 );
/* if( always ) */ Enroll( UTF1, 11 );
Enroll( UTF5, 12 );
Enroll( UTF7, 13 );
Enroll( UTF8, 14 );
EnrollS( UTF8N, 15 );
Enroll( UTF9, 16 );
EnrollS( UTF16b, 17 );
EnrollS( UTF16l, 18 );
Enroll( UTF16BE, 19 );
Enroll( UTF16LE, 20 );
EnrollS( UTF32b, 21 );
EnrollS( UTF32l, 22 );
Enroll( UTF32BE, 23 );
Enroll( UTF32LE, 24 );
if( ::IsValidCodePage(850) ) Enroll( WesternDOS, 25 );
Enroll( Western, 26 );
if( ::IsValidCodePage(852) ) Enroll( CentralDOS, 27 );
if( ::IsValidCodePage(28592) ) Enroll( Central, 28 );
if( ::IsValidCodePage(855) ) Enroll( CyrillicIBM, 29 );
if( ::IsValidCodePage(866) ) Enroll( CyrillicDOS, 30 );
if( ::IsValidCodePage(28595) ) Enroll( Cyrillic, 31 );
if( ::IsValidCodePage(20866) ) Enroll( Koi8R, 32 );
if( ::IsValidCodePage(21866) ) Enroll( Koi8U, 33 );
if( ::IsValidCodePage(874) ) Enroll( Thai, 34 );
if( ::IsValidCodePage(857) ) Enroll( TurkishDOS, 35 );
if( ::IsValidCodePage(1254) ) Enroll( Turkish, 36 );
if( ::IsValidCodePage(775) ) Enroll( BalticIBM, 37 );
if( ::IsValidCodePage(1257) ) Enroll( Baltic, 38 );
if( ::IsValidCodePage(1258) ) Enroll( Vietnamese, 39 );
if( ::IsValidCodePage(737) ) Enroll( GreekIBM, 40 );
if( ::IsValidCodePage(869) ) Enroll( GreekMSDOS, 41 );
if( ::IsValidCodePage(28597) ) Enroll( Greek, 42 );
if( ::IsValidCodePage(720) ) Enroll( ArabicIBM, 43 );
if( ::IsValidCodePage(864) ) Enroll( ArabicMSDOS, 44 );
if( ::IsValidCodePage(1256) ) Enroll( Arabic, 45 );
if( ::IsValidCodePage(862) ) Enroll( HebrewDOS, 46 );
if( ::IsValidCodePage(1255) ) Enroll( Hebrew, 47 );
if( ::IsValidCodePage(860) ) Enroll( Portuguese, 48 );
if( ::IsValidCodePage(861) ) Enroll( Icelandic, 49 );
if( ::IsValidCodePage(863) ) Enroll( CanadianFrench, 50 );
if( ::IsValidCodePage(865) ) Enroll( Nordic, 51 );
Enroll( DOSUS, 52 );
/* if( always ) */ EnrollS( UTF1, 11 );
Enroll( UTF1Y, 12 );
Enroll( UTF5, 13 );
Enroll( UTF7, 14 );
Enroll( UTF8, 15 );
EnrollS( UTF8N, 16 );
EnrollS( UTF9, 17 );
Enroll( UTF9Y, 18 );
EnrollS( UTF16b, 19 );
EnrollS( UTF16l, 20 );
Enroll( UTF16BE, 21 );
Enroll( UTF16LE, 22 );
EnrollS( UTF32b, 23 );
EnrollS( UTF32l, 24 );
Enroll( UTF32BE, 25 );
Enroll( UTF32LE, 26 );
if( ::IsValidCodePage(850) ) Enroll( WesternDOS, 27 );
Enroll( Western, 28 );
if( ::IsValidCodePage(852) ) Enroll( CentralDOS, 29 );
if( ::IsValidCodePage(28592) ) Enroll( Central, 30 );
if( ::IsValidCodePage(855) ) Enroll( CyrillicIBM, 31 );
if( ::IsValidCodePage(866) ) Enroll( CyrillicDOS, 32 );
if( ::IsValidCodePage(28595) ) Enroll( Cyrillic, 33 );
if( ::IsValidCodePage(20866) ) Enroll( Koi8R, 34 );
if( ::IsValidCodePage(21866) ) Enroll( Koi8U, 35 );
if( ::IsValidCodePage(874) ) Enroll( Thai, 36 );
if( ::IsValidCodePage(857) ) Enroll( TurkishDOS, 37 );
if( ::IsValidCodePage(1254) ) Enroll( Turkish, 38 );
if( ::IsValidCodePage(775) ) Enroll( BalticIBM, 39 );
if( ::IsValidCodePage(1257) ) Enroll( Baltic, 40 );
if( ::IsValidCodePage(1258) ) Enroll( Vietnamese, 41 );
if( ::IsValidCodePage(737) ) Enroll( GreekIBM, 42 );
if( ::IsValidCodePage(869) ) Enroll( GreekMSDOS, 43 );
if( ::IsValidCodePage(28597) ) Enroll( Greek, 44 );
if( ::IsValidCodePage(720) ) Enroll( ArabicIBM, 45 );
if( ::IsValidCodePage(864) ) Enroll( ArabicMSDOS, 46 );
if( ::IsValidCodePage(1256) ) Enroll( Arabic, 47 );
if( ::IsValidCodePage(862) ) Enroll( HebrewDOS, 48 );
if( ::IsValidCodePage(1255) ) Enroll( Hebrew, 49 );
if( ::IsValidCodePage(860) ) Enroll( Portuguese, 50 );
if( ::IsValidCodePage(861) ) Enroll( Icelandic, 51 );
if( ::IsValidCodePage(863) ) Enroll( CanadianFrench, 52 );
if( ::IsValidCodePage(865) ) Enroll( Nordic, 53 );
Enroll( DOSUS, 54 );
 
// I—¹
#undef Enroll
/GreenPad/kilib/textfile.cpp
@@ -38,11 +38,14 @@
 
struct rBasicUTF : public ki::TextFileRPimpl
{
inline rBasicUTF() : FOF(true) {}
virtual unicode PeekC() = 0;
virtual unicode GetC() {unicode ch=PeekC(); Skip(); return ch;}
virtual void Skip() = 0;
virtual bool Eof() = 0;
 
bool FOF;
 
size_t ReadLine( unicode* buf, ulong siz )
{
state = EOF;
@@ -52,16 +55,18 @@
while( !Eof() )
{
*w = GetC();
if(FOF && *w!=0xfeff) FOF = false;
if( *w==L'\r' || *w==L'\n' )
{
state = EOL;
break;
}
else if( *w!=0xfeff && ++w==e )
else if( !FOF && ++w==e )
{
state = EOB;
break;
}
if(FOF) FOF = false;
}
 
// ‰üsƒR[ƒhƒXƒLƒbƒvˆ—
@@ -69,6 +74,7 @@
if( *w==L'\r' && !Eof() && PeekC()==L'\n' )
Skip();
 
if(FOF) FOF = false;
// “Ç‚ñ‚¾•¶Žš”
return w-buf;
}
@@ -724,9 +730,11 @@
case UTF32BE: impl_ = new rUtf32(buf,siz,true); break;
case UTF32l:
case UTF32LE: impl_ = new rUtf32(buf,siz,false); break;
case UTF1Y:
case UTF1: impl_ = new rUtf1(buf,siz); break;
case UTF5: impl_ = new rUtf5(buf,siz); break;
case UTF7: impl_ = new rUtf7(buf,siz); break;
case UTF9Y:
case UTF9: impl_ = new rUtf9(buf,siz); break;
case EucJP: impl_ = new rIso2022(buf,siz,true,false,ASCII,JIS,KANA); break;
case IsoJP: impl_ = new rIso2022(buf,siz,false,false,ASCII,KANA); break;
@@ -792,7 +800,9 @@
 
bool Jp = ::IsValidCodePage(932)!=FALSE;
 
if( (bom4>>8) == 0xefbbbf ) cs = UTF8;
if( (bom4>>8) == 0xefbbbf ) cs = UTF8;
else if( (bom4>>8) == 0xf7644c ) cs = UTF1Y;
else if( (bom4>>8) == 0x93fdff ) cs = UTF9Y;
else if( bom4 == 0x0000feff ) cs = UTF32b;
else if( bom4 == 0xfffe0000 ) cs = UTF32l;
else if( bom2 == 0xfeff ) cs = UTF16b;
@@ -1112,7 +1122,11 @@
 
struct wUtf1 : public TextFileWPimpl
{
wUtf1( FileW& w ) : TextFileWPimpl(w) {}
wUtf1( FileW& w, bool bom ) : TextFileWPimpl(w)
{
if( bom ) // BOM‘‚«ž‚Ý
fp_.Write( "\xF7\x64\x4C", 3 );
}
inline qbyte conv ( qbyte x )
{
if( x<=0x5D ) return x + 0x21;
@@ -1145,7 +1159,11 @@
 
struct wUtf9 : public TextFileWPimpl
{
wUtf9( FileW& w ) : TextFileWPimpl(w) {}
wUtf9( FileW& w, bool bom ) : TextFileWPimpl(w)
{
if( bom ) // BOM‘‚«ž‚Ý
fp_.Write( "\x93\xFD\xFF", 3 );
}
void WriteChar( unicode ch )
{
if( ch <= 0x7F || (ch >= 0xA0 && ch <= 0xFF ))
@@ -1649,9 +1667,11 @@
switch( cs_ )
{
case Western: impl_ = new wWest( fp_ ); break;
case UTF1: impl_ = new wUtf1( fp_ ); break;
case UTF1Y:
case UTF1: impl_ = new wUtf1( fp_, cs_==UTF1Y ); break;
case UTF5: impl_ = new wUtf5( fp_ ); break;
case UTF9: impl_ = new wUtf9( fp_ ); break;
case UTF9:
case UTF9Y: impl_ = new wUtf9( fp_, cs_==UTF9Y ); break;
case UTF16l:
case UTF16LE: impl_ = new wUtf16LE( fp_, cs_==UTF16l ); break;
case UTF16b:
/GreenPad/kilib/textfile.h
@@ -84,6 +84,8 @@
UTF32BE = -9, // Unicode (UTF-32BE): BOM–³‚µ
UTF32LE = -10, // Unicode (UTF-32LE): BOM–³‚µ
UTF9 = -11, // Unicode (UTF-9) : BOM–³‚µ
UTF1Y =-64999,// Unicode (UTF-1) : BOM—L‚è
UTF9Y =-65002,// Unicode (UTF-9) : BOM—L‚è
 
DOSUS = 437 // DOSLatinUS (CP437)
};