Add comment noting %(escape)s limitation

This commit is contained in:
Olly Betts 2024-08-17 16:17:24 +12:00
parent 7a8c9fdfa8
commit 0ae9bb987e
1 changed files with 9 additions and 0 deletions

View File

@ -356,6 +356,15 @@ int Swig_storage_isstatic(Node *n) {
* Takes a string object and produces a string with escape codes added to it.
* Octal escaping is used. The result is used for literal strings and characters
* in C/C++ and also Java and R.
*
* The result is suitable for wrapping in single or double quotes to form a
* character or string literal.
*
* Note that it's not safe to concatenate the results of escaping two strings
* - you need to concatenate first and escape second. The problem case is
* when the first string ends with a character which gets escaped using one or
* two octal digits and the second string starts with a character which is an
* octal digit.
* ----------------------------------------------------------------------------- */
String *Swig_string_escape(String *s) {