File: python_iostream_encoding_MR11494.diff

package info (click to toggle)
paraview 5.13.2%2Bdfsg-3.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 544,660 kB
  • sloc: cpp: 3,374,605; ansic: 1,332,409; python: 150,381; xml: 122,166; sql: 65,887; sh: 7,317; javascript: 5,262; yacc: 4,417; java: 3,977; perl: 2,363; lex: 1,929; f90: 1,397; makefile: 170; objc: 153; tcl: 59; pascal: 50; fortran: 29
file content (32 lines) | stat: -rw-r--r-- 1,517 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/VTK/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h b/VTK/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
index 54c7476bf01e929a81472de13b8b0231a489374f..e162f359d05420c45859f8c59ee647606ae8352f 100644
--- a/VTK/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
+++ b/VTK/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
@@ -16,7 +16,8 @@ VTK_ABI_NAMESPACE_BEGIN
 struct vtkPythonStdStreamCaptureHelper
 {
   PyObject_HEAD
-  int softspace; // Used by print to keep track of its state.
+  int softspace;        // Used by print to keep track of its state.
+  const char* Encoding; // Encoding, set to "utf-8"
   bool DumpToError;
 
   void Write(const char* string)
@@ -84,6 +85,9 @@ static PyMemberDef vtkPythonStdStreamCaptureHelperMembers[] = {
   { VTK_PYTHON_MEMBER_DEF_STR("softspace"), T_INT,
     offsetof(vtkPythonStdStreamCaptureHelper, softspace), 0,
     VTK_PYTHON_MEMBER_DEF_STR("Placeholder so print can keep state.") },
+  { VTK_PYTHON_MEMBER_DEF_STR("encoding"), T_STRING,
+    offsetof(vtkPythonStdStreamCaptureHelper, Encoding), READONLY,
+    VTK_PYTHON_MEMBER_DEF_STR("Text encoding for file.") },
   { nullptr, 0, 0, 0, nullptr }
 };
 
@@ -250,6 +254,7 @@ static vtkPythonStdStreamCaptureHelper* NewPythonStdStreamCaptureHelper(bool for
     PyObject_New(vtkPythonStdStreamCaptureHelper, &vtkPythonStdStreamCaptureHelperType);
   if (wrapper)
   {
+    wrapper->Encoding = "utf-8";
     wrapper->DumpToError = for_stderr;
   }