From: Tom Serface on 13 Mar 2008 11:03 So far as I can see same as C++ using function calls: http://www.java2s.com/Code/CSharp/File-Stream/ConvertUTF8andASCIIencodedbytesbacktoUTF16encodedstring.htm I agree about CString. That is one class that should make it's way into standard C++ imo. Tom "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message news:fcdit3t1nr1n1or173gin7ibb0s4di3tur(a)4ax.com... > Actually, you only need one class for strings, CString. In very rare and > exotic > circumstances where you need to be aware of the character set differences, > you can use > CStringA or CStringW. std::string is largely irrelevant for MFC > programmers. _T() is > just part of the standard syntax. > > By the way, does C# have a way to convert to UTF-8 and back? > joe >
From: Tom Serface on 13 Mar 2008 11:08 Hi Joe, This is turning into a C# support forum :o) I'm working with C# in ASP.NET and I use a globalresources.resx file paradigm and I can do something like: String cs = Resources.GlobalResources.MyString; Which will grab the string from whichever culture file is active (language). I find this to be even handier than trying to use LoadString() and having to load the resource DLL's etc. Since my application is running in a browser I can also just change my preferred language in the browser settings to switch between languages. Very handy for testing. I think ToString() is handy, but I seldom use it since it except with numbers since it ignores the translation mechanism. Tom "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message news:mfdit35hgfk3qf828of54ppqahgrs0und2(a)4ax.com... > Up to a certain point, const declarations and generics will help. But > every once in a > while, having a code-generator integrated into the compiler system is > useful, such as > > #define TYPECASE(x) case x: return _T(#x); break > > and similar techniques. In the absence of good macros, tricks like this > become difficult, > although the C# ToString function handles the above situation trivially, > it doesn't > generalize to situations such as > > #define TYPECASE(x) case x: s.LoadString(IDS_#x); return s > > where localization is necessary. Since C# seems to embed all the literals > int he code > instead of in resources, I find this doesn't help a lot (what is the > opposition to dialog > templates, STRINGTABLE, MESSAGETABLE, etc. in C#?) > joe
From: Giovanni Dicanio on 13 Mar 2008 12:20 "Joseph M. Newcomer" <newcomer(a)flounder.com> ha scritto nel messaggio news:fcdit3t1nr1n1or173gin7ibb0s4di3tur(a)4ax.com... > By the way, does C# have a way to convert to UTF-8 and back? I've not done that conversion using C#, but a Google search gives that result I find interesting: http://msdn2.microsoft.com/en-us/library/system.text.encoding.utf8.aspx Giovanni
From: David Ching on 13 Mar 2008 12:44 "David Wilkinson" <no-reply(a)effisols.com> wrote in message news:%233GOU0OhIHA.5900(a)TK2MSFTNGP02.phx.gbl... > Yes, but you only have to do it once. It's not like the constant annoyance > of fighting the "Add Control Variable" wizard in the "new" IDE. > I've never understood the outcry about that. It's no big deal. You add one variable, type Alt+W 2 to go back to the dialog window, select the next control, and add it. My beef with the wizard is it adds stupid include files like afxcmn.h and doesn't attempt to group control variables together. I'm constantly cleaning up after it. But I wouldn't go back to VC6. If for no other reason that I always forget the name of the UNICODE entrypoint that you have to put into the linker dialog because the wrong one is used by default. -- David
From: Joseph M. Newcomer on 13 Mar 2008 15:02
I have hopes for VS2008+1. We might see some improvements if the rumors I've heard on this newsgroup are true. Perhaps we might even learn stuff at the MVP Summit that is public (most of it, I'm sure, will be NDA). joe On Thu, 13 Mar 2008 09:44:06 -0700, "David Ching" <dc(a)remove-this.dcsoft.com> wrote: >"David Wilkinson" <no-reply(a)effisols.com> wrote in message >news:%233GOU0OhIHA.5900(a)TK2MSFTNGP02.phx.gbl... >> Yes, but you only have to do it once. It's not like the constant annoyance >> of fighting the "Add Control Variable" wizard in the "new" IDE. >> > >I've never understood the outcry about that. It's no big deal. You add one >variable, type Alt+W 2 to go back to the dialog window, select the next >control, and add it. > >My beef with the wizard is it adds stupid include files like afxcmn.h and >doesn't attempt to group control variables together. I'm constantly >cleaning up after it. > >But I wouldn't go back to VC6. If for no other reason that I always forget >the name of the UNICODE entrypoint that you have to put into the linker >dialog because the wrong one is used by default. > >-- David > Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |