aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tests/utf.cpp42
1 files changed, 42 insertions, 0 deletions
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 @@
4 4
5int main( int argc, char *argv[] ) 5int main( int argc, char *argv[] )
6{ 6{
7 Bu::File fIn("utf8.in", Bu::File::Read );
8 Bu::String sUtf8;
9 char buf[4096];
10 while( !fIn.isEos() )
11 {
12 int iAmnt = fIn.read( buf, 4096 );
13 sUtf8.append( buf, iAmnt );
14 }
15 Bu::UtfString us( sUtf8, Bu::UtfString::Utf8 );
16 us.debug();
17 {
18 Bu::File fOut("utf8.out", Bu::File::WriteNew );
19 us.write( fOut, Bu::UtfString::Utf8 );
20 }
21 {
22 Bu::File fOut("utf16.out", Bu::File::WriteNew );
23 us.write( fOut, Bu::UtfString::Utf16 );
24 }
25 {
26 Bu::File fOut("utf16le.out", Bu::File::WriteNew );
27 us.write( fOut, Bu::UtfString::Utf16le );
28 }
29 {
30 Bu::File fOut("utf16be.out", Bu::File::WriteNew );
31 us.write( fOut, Bu::UtfString::Utf16be );
32 }
33 {
34 Bu::File fOut("utf32.out", Bu::File::WriteNew );
35 us.write( fOut, Bu::UtfString::Utf32 );
36 }
37 {
38 Bu::File fOut("utf32le.out", Bu::File::WriteNew );
39 us.write( fOut, Bu::UtfString::Utf32le );
40 }
41 {
42 Bu::File fOut("utf32be.out", Bu::File::WriteNew );
43 us.write( fOut, Bu::UtfString::Utf32be );
44 }
45
46 /*
7 argc--, argv++; 47 argc--, argv++;
8 48
9 for( char **sFile = argv; *sFile; sFile++ ) 49 for( char **sFile = argv; *sFile; sFile++ )
@@ -17,7 +57,9 @@ int main( int argc, char *argv[] )
17 sUtf8.append( buf, iAmnt ); 57 sUtf8.append( buf, iAmnt );
18 } 58 }
19 Bu::UtfString us( sUtf8, Bu::UtfString::Utf16 ); 59 Bu::UtfString us( sUtf8, Bu::UtfString::Utf16 );
60
20 us.debug(); 61 us.debug();
21 } 62 }
63 */
22} 64}
23 65