Click here to Skip to main content
15,922,427 members
Home / Discussions / C#
   

C#

 
GeneralRe: Validating user login Pin
Guinness4Strength16-Jun-05 7:32
Guinness4Strength16-Jun-05 7:32 
GeneralRuntime cast down inheritance tree Pin
Gizz16-Jun-05 4:51
Gizz16-Jun-05 4:51 
GeneralRe: Runtime cast down inheritance tree Pin
S. Senthil Kumar16-Jun-05 5:10
S. Senthil Kumar16-Jun-05 5:10 
GeneralRe: Runtime cast down inheritance tree Pin
Colin Angus Mackay16-Jun-05 5:29
Colin Angus Mackay16-Jun-05 5:29 
QuestionIs it possible to store unicode as Ansi and convert back again? Pin
Member 9616-Jun-05 4:39
Member 9616-Jun-05 4:39 
AnswerRe: Is it possible to store unicode as Ansi and convert back again? Pin
Dave Kreskowiak16-Jun-05 5:08
mveDave Kreskowiak16-Jun-05 5:08 
GeneralRe: Is it possible to store unicode as Ansi and convert back again? Pin
Member 9616-Jun-05 5:11
Member 9616-Jun-05 5:11 
Answer*SOLVED* Pin
Member 9616-Jun-05 6:40
Member 9616-Jun-05 6:40 
Found it, for the elucidation of others it's dead simple:

//Convert to ascii 7 bit text for saving to a database that doesn't support unicode:
//(or smtp or whatever)
string u="Hindi: यूनिकोड क्या है?";
string encoded=Encoding.ASCII.GetString(Encoding.UTF7.GetBytes(u));
//which ends up looking like this:
//"Hindi: +CS8JQgkoCT8JFQlLCSE- +CRUJTQkvCT4- +CTkJSA-?"

//Converting back to unicode:
string decoded=Encoding.ASCII.GetString(Encoding.UTF7.GetBytes(u));

What's interesting is that apparently it delimits every string of text that contains characters outside the ascii code range so when you have a mixed string as above of English and Unicode it's more efficient to do it this way than to base64 the whole thing because it will only do the bits it needs to which is what applies in the app we're working on that will often contain mixed text.





"A preoccupation with the next world pretty clearly signals an inability to cope credibly with this one."
GeneralRe: *SOLVED* Pin
Dave Kreskowiak16-Jun-05 8:09
mveDave Kreskowiak16-Jun-05 8:09 
GeneralParsing IL Pin
gantww16-Jun-05 4:06
gantww16-Jun-05 4:06 
GeneralRe: Parsing IL Pin
iliyang16-Jun-05 4:11
iliyang16-Jun-05 4:11 
QuestionImporting Macros from C header files? Pin
iliyang16-Jun-05 4:03
iliyang16-Jun-05 4:03 
AnswerRe: Importing Macros from C header files? Pin
Colin Angus Mackay16-Jun-05 4:32
Colin Angus Mackay16-Jun-05 4:32 
AnswerRe: Importing Macros from C header files? Pin
Dave Kreskowiak16-Jun-05 4:55
mveDave Kreskowiak16-Jun-05 4:55 
GeneralRe: Importing Macros from C header files? Pin
iliyang16-Jun-05 5:06
iliyang16-Jun-05 5:06 
GeneralRe: Importing Macros from C header files? Pin
Dave Kreskowiak16-Jun-05 5:10
mveDave Kreskowiak16-Jun-05 5:10 
GeneralNow Im really irritated!! Pin
Anthony Mushrow16-Jun-05 3:07
professionalAnthony Mushrow16-Jun-05 3:07 
GeneralRe: Now Im really irritated!! Pin
iliyang16-Jun-05 4:08
iliyang16-Jun-05 4:08 
GeneralRe: Now Im really irritated!! Pin
Michael Potter16-Jun-05 4:15
Michael Potter16-Jun-05 4:15 
Generalretrieving http sites (frames) Pin
alexffm16-Jun-05 3:00
alexffm16-Jun-05 3:00 
GeneralRe: retrieving http sites (frames) Pin
S. Senthil Kumar16-Jun-05 3:18
S. Senthil Kumar16-Jun-05 3:18 
GeneralRe: retrieving http sites (frames) Pin
alexffm16-Jun-05 3:31
alexffm16-Jun-05 3:31 
GeneralRe: retrieving http sites (frames) Pin
S. Senthil Kumar16-Jun-05 3:45
S. Senthil Kumar16-Jun-05 3:45 
GeneralRe: retrieving http sites (frames) Pin
alexffm16-Jun-05 3:54
alexffm16-Jun-05 3:54 
GeneralCompiling C# Code at runtime Pin
Sumit Domyan16-Jun-05 2:33
Sumit Domyan16-Jun-05 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.