Changeset 218
- Timestamp:
- 07/25/08 19:39:13 (6 months ago)
- Files:
-
- trunk/dsss.conf (modified) (1 diff)
- trunk/dwt (added)
- trunk/dwt/LinkText.d (added)
- trunk/dwtx (added)
- trunk/dwtx/PasswordFieldEditor.d (added)
- trunk/lib/dwin.lib (modified) (previous)
- trunk/sys/win32/CodePage.d (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dsss.conf
r191 r218 6 6 exclude+=dwin\sys\win32\* 7 7 } 8 version (!DWT) { 9 exclude+=dwin\dwt\* 10 } 11 version (!DWTX) { 12 exclude+=dwin\dwtx\* 13 } 14 trunk/sys/win32/CodePage.d
r205 r218 1 1 /******************************************************************************* 2 2 3 3 copyright: Copyright (c) 2007 (yidabu gmail at com) All rights reserved 4 4 … … 12 12 13 13 14 14 15 15 module dwin.sys.win32.CodePage; 16 16 … … 18 18 private import tango.stdc.stringz : toUTF16z = toString16z; 19 19 public import tango.sys.win32.CodePage; 20 20 21 21 22 22 //////////////////////////////////////////////////////////////////////////////// … … 47 47 // 48 48 49 char[] toMbs(Buf) (Buf buf) 50 { 51 static if( is(Buf == char[]) || is(Buf == wchar[]) || is(Buf == dchar[]) || is(Buf == wchar*) ) 52 return CodePage.into( toString(buf), new char[buf.length*3] ); 53 else static assert( false, "Code.Page.toMbs, wrong parameter" ); 54 } 55 // 56 49 57 50 58 … … 68 76 } 69 77 70 wchar* toString16z(char[] input) 71 { 78 wchar* toString16z(char[] input) 79 { 72 80 return toString16z( toString16(input) ); 73 81 } 74 82 // 75 83 76 wchar* toString16z(char[] input, int start, int count) 84 wchar* toString16z(char[] input, int start, int count) 77 85 { 78 86 if (input is null) … … 82 90 if (count == -1) 83 91 count = input.length; 84 92 85 93 return toString16z( toString16(input[start .. count]) ); 86 94 } … … 102 110 if ( !(input.length > 1 && input[$-1] is 0 && input[$-2] is 0) ) 103 111 input = input ~ "\0\0"w; 104 return input.ptr; 112 return input.ptr; 105 113 } 106 114 … … 110 118 } 111 119 112 wchar* toString16zz(char[] input) 113 { 120 wchar* toString16zz(char[] input) 121 { 114 122 return toString16zz( toString16(input) ); 115 123 } … … 119 127 /+ 120 128 //////////////////////////////////////////////////////////////////////////////// 121 // MBSz to UTF 129 // MBSz to UTF 122 130 //////////////////////////////////////////////////////////////////////////////// 123 131 … … 158 166 159 167 if (!readLen || readLen != result.length) 160 throw new IllegalArgumentException ("Stringz.toString16 :: "~SysError.lastMsg); 168 throw new IllegalArgumentException ("Stringz.toString16 :: "~SysError.lastMsg); 161 169 162 170 return result[0 .. result.length-1]; // omit trailing null
