From 27aecbc60be6c80ce221f29c01f743de714faa63 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 7 Apr 2011 05:44:42 +0000 Subject: Pretty sure all utf encoders and decoders are complete and tested. --- src/tests/utf.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/tests') diff --git a/src/tests/utf.cpp b/src/tests/utf.cpp index 9e075e2..01bac7e 100644 --- a/src/tests/utf.cpp +++ b/src/tests/utf.cpp @@ -4,6 +4,46 @@ int main( int argc, char *argv[] ) { + Bu::File fIn("utf8.in", Bu::File::Read ); + Bu::String sUtf8; + char buf[4096]; + while( !fIn.isEos() ) + { + int iAmnt = fIn.read( buf, 4096 ); + sUtf8.append( buf, iAmnt ); + } + Bu::UtfString us( sUtf8, Bu::UtfString::Utf8 ); + us.debug(); + { + Bu::File fOut("utf8.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf8 ); + } + { + Bu::File fOut("utf16.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf16 ); + } + { + Bu::File fOut("utf16le.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf16le ); + } + { + Bu::File fOut("utf16be.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf16be ); + } + { + Bu::File fOut("utf32.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf32 ); + } + { + Bu::File fOut("utf32le.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf32le ); + } + { + Bu::File fOut("utf32be.out", Bu::File::WriteNew ); + us.write( fOut, Bu::UtfString::Utf32be ); + } + + /* argc--, argv++; for( char **sFile = argv; *sFile; sFile++ ) @@ -17,7 +57,9 @@ int main( int argc, char *argv[] ) sUtf8.append( buf, iAmnt ); } Bu::UtfString us( sUtf8, Bu::UtfString::Utf16 ); + us.debug(); } + */ } -- cgit v1.2.3