4

OpenGL has a few functions like glGetString and glGetShaderInfoLog that return strings. What form of text encoding is used for these?

I assume, given that they're returned as a GLchar*, that it is ASCII encoded text contained in the return value but is this specified anywhere?

As a second and related point, what text encoding is expected by functions such as glShaderSource and glBindAttribLocation. Do GLSL programs have to be encoded in ASCII or can it be UTF-8?

Milliams
  • 1,443
  • 1
  • 22
  • 30
  • Related: https://stackoverflow.com/questions/36241598/vertex-shader-not-compiling-due-to-a-non-ascii-character. Is seems `glShaderSource` does not handle anything other than plain ASCII well. – Suma Dec 01 '18 at 13:48

1 Answers1

3

OpenGL 4.3 Compatibility Profile Specification, section 22.2, page 627:

String queries return pointers to UTF-8 encoded, null-terminated static strings describing properties of the current GL context.

As far as I can see the spec doesn't mention the encoding of glGetShaderInfoLog().

genpfault
  • 49,394
  • 10
  • 79
  • 128