Open Bug 1447674 Opened 7 years ago Updated 2 years ago

[meta] Get rid of std::wstring

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: hsivonen, Unassigned)

References

Details

(Keywords: meta)

We have a bunch of uses of std::wstring in the IPC code and in code that needs to implement IPC-imposed signatures: https://searchfox.org/mozilla-central/search?q=std%3A%3Awstring&case=false&regexp=false&path= std::wstring is not portable. It is UTF-32 on Linux and UTF-16 on Windows. We should replace the usage of std::wstring with one of: * nsACString holding UTF-8 * nsAString holding UTF-16 * std::string holding UTF-8 * std::u16string holding UTF-16 It's unclear to me which of UTF-8 or UTF-16 would result in fewer conversions and it's unclear to me if using XPCOM strings would be hard. At least std::string or std::u16string would keep code structurally the same as before.
Some of this might be dead code, or nearly dead — I have patches in the pipeline to completely remove file_util and also remove the names from shared_memory, and I suspect that parts of the string_util and command_line stuff might be unused.
Priority: -- → P3

There's going to be a certain amount of wstring usage in IPC which is for use with Windows APIs that use wchar_t, so XPCOM strings might actually be the better option despite the differences in method names — if I recall correctly they can auto-cast raw pointers as needed, whereas u16string would need manual casting.

Summary: Get rid of std::wstring → [meta] Get rid of std::wstring
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.