[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-10 Thread Mohamed Mansour
Alright, I spent most of the night (now its 7AM) trying to do this. Don't be mad if I misunderstood some concept. Chromium is my first experience in c++. If someone could skim through it, especially the values.cc, pref_service.cc, pref_members.cc, and some of the other classes. Note, this is not

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread 王重傑
Is there a place that actually describes when it's appropriate to use which string type, and how to know if we should be fixing code we run across? Is everything just supposed to be string16? -Albert On Fri, May 1, 2009 at 11:59 AM, Evan Martin e...@chromium.org wrote: We have a bunch of

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Mike Pinkerton
Well, in this case they're not user-visible, so there's no reason for them to not be char*s. Unless I'm missing something obvious. On Fri, May 1, 2009 at 3:02 PM, Albert J. Wong (王重傑) ajw...@chromium.org wrote: Is there a place that actually describes when it's appropriate to use which string

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Tony Chang
The history is that the Value type, which is the underlying data type used by PrefService used to only have wstring types. This bled into PrefService which caused PrefService to only understand wstring as keys. I'd be happy to see a patch that changed PrefService keys to std::string or char*

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Andrew Scherkus
I once went on a mission to change Value to use UTF-8 strings, and hilariously enough after doing a few of those changes we ended up with string16. Maybe I'll go on another crusade to change Value to use string16... Anyway, the tricky part is that it's the Dictionary Value type forcing wstring.

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Mohamed Mansour
Hi, I have done a small patch that converts the pref's to use wstring instead of wchar_t (everywhere in the code). It is just a few places. The code compiles. But I would like to get some advice on why some errors occur. I don't know who would like to CR this...

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Evan Martin
A wstring is a C++ wrapper around a wchar_t string. What Mike was proposing was changing to char*. 2009/5/1 Mohamed Mansour m0.interact...@gmail.com: Hi, I have done a small patch that converts the pref's to use wstring instead of wchar_t (everywhere in the code). It is just a few places. The

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Mohamed Mansour
Why wouldn't we just use std::string ? Many places in the code uses std::string. DictionaryValue needs to be converted as well as many others. So what do we finally decide, go what Pink stated and use char* or use std::string. 2009/5/1 Evan Martin e...@chromium.org A wstring is a C++ wrapper

[chromium-dev] Re: Why are pref keys wchar_t's?

2009-05-01 Thread Brett Wilson
2009/5/1 Mohamed Mansour m0.interact...@gmail.com: Why wouldn't we just use std::string ? Many places in the code uses std::string. DictionaryValue needs to be converted as well as many others. So what do we finally decide, go what Pink stated and use char* or use std::string. I believe the