diff --git a/g3doc/style-guide.md b/g3doc/style-guide.md index 71d1196df2..b32163f906 100644 --- a/g3doc/style-guide.md +++ b/g3doc/style-guide.md @@ -127,6 +127,19 @@ For example, See the [source code for `rtc::ArrayView`](api/array_view.h) for more detailed docs. +### Strings + +WebRTC uses std::string, with content assumed to be UTF-8. Note that this +has to be verified whenever accepting external input. + +For concatenation of strings, use rtc::SimpleStringBuilder. + +The following string building tools are NOT recommended: +* The + operator. See https://abseil.io/tips/3 for why not. +* absl::StrCat, absl::StrAppend, absl::StrJoin. These are optimized for + speed, not code size, and have significant code size overhead. +* strcat. It is too easy to create buffer overflows. + ### sigslot SIGSLOT IS DEPRECATED.