[Mesa-dev] [PATCH 02/41] glapi: encode python files in utf-8 rather than ascii

Ian Romanick idr at freedesktop.org
Tue Apr 19 19:51:04 UTC 2016


On 03/31/2016 05:04 PM, Dylan Baker wrote:
> This allows, among other things, the proper use of the Copyright symbol
> in the copyright header (which this patch also does).
> 
> It cannot be used in the printed templates however, because they are
> printed, not directly written to a file. If a user doesn't have a UTF-8
> locale (or has an operating system that doesn't have UTF-8 support)
> then that would fail.
> 
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  src/mapi/glapi/gen/apiexec.py          | 3 ++-
>  src/mapi/glapi/gen/glX_XML.py          | 3 ++-
>  src/mapi/glapi/gen/glX_proto_common.py | 3 ++-
>  src/mapi/glapi/gen/glX_proto_recv.py   | 3 ++-
>  src/mapi/glapi/gen/glX_proto_send.py   | 5 +++--
>  src/mapi/glapi/gen/glX_proto_size.py   | 3 ++-
>  src/mapi/glapi/gen/glX_server_table.py | 3 ++-
>  src/mapi/glapi/gen/gl_SPARC_asm.py     | 3 ++-
>  src/mapi/glapi/gen/gl_XML.py           | 4 +++-
>  src/mapi/glapi/gen/gl_apitemp.py       | 3 ++-
>  src/mapi/glapi/gen/gl_enums.py         | 7 ++++---
>  src/mapi/glapi/gen/gl_genexec.py       | 3 ++-
>  src/mapi/glapi/gen/gl_gentable.py      | 7 ++++---
>  src/mapi/glapi/gen/gl_procs.py         | 3 ++-
>  src/mapi/glapi/gen/gl_table.py         | 5 +++--
>  src/mapi/glapi/gen/gl_x86-64_asm.py    | 3 ++-
>  src/mapi/glapi/gen/gl_x86_asm.py       | 3 ++-
>  src/mapi/glapi/gen/license.py          | 4 +++-
>  src/mapi/glapi/gen/remap_helper.py     | 3 ++-
>  src/mapi/glapi/gen/static_data.py      | 3 ++-
>  src/mapi/glapi/gen/typeexpr.py         | 3 ++-
>  21 files changed, 50 insertions(+), 27 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
> index b4f4cf6..670dc4a 100644
> --- a/src/mapi/glapi/gen/apiexec.py
> +++ b/src/mapi/glapi/gen/apiexec.py
> @@ -1,4 +1,5 @@
> -# Copyright (C) 2015 Intel Corporation
> +# encoding=utf-8
> +# Copyright © 2015 Intel Corporation
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
>  # copy of this software and associated documentation files (the "Software"),
> diff --git a/src/mapi/glapi/gen/glX_XML.py b/src/mapi/glapi/gen/glX_XML.py
> index 6987e27..318fe27 100644
> --- a/src/mapi/glapi/gen/glX_XML.py
> +++ b/src/mapi/glapi/gen/glX_XML.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005

Do not change the IBM copyrights.  IBM's lawyers very specifically
instructed us to use (C).  I don't actually know what the Intel lawyers
say, but we should investigate that.

I'd also be a bit reluctant to mess with the copyright attribution of
other companies or individuals.  Lawyer types are really picky about
that sort of stuff.

>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/glX_proto_common.py b/src/mapi/glapi/gen/glX_proto_common.py
> index bcfe009..f04e065 100644
> --- a/src/mapi/glapi/gen/glX_proto_common.py
> +++ b/src/mapi/glapi/gen/glX_proto_common.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/glX_proto_recv.py b/src/mapi/glapi/gen/glX_proto_recv.py
> index ec3f7d7..c557f69 100644
> --- a/src/mapi/glapi/gen/glX_proto_recv.py
> +++ b/src/mapi/glapi/gen/glX_proto_recv.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2005
> +# © Copyright IBM Corporation 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
> index 5904b33..dc05eba 100644
> --- a/src/mapi/glapi/gen/glX_proto_send.py
> +++ b/src/mapi/glapi/gen/glX_proto_send.py
> @@ -1,8 +1,9 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005
>  # All Rights Reserved.
> -# Copyright (c) 2015 Intel Corporation
> +# Copyright © 2015 Intel Corporation
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
>  # copy of this software and associated documentation files (the "Software"),
> diff --git a/src/mapi/glapi/gen/glX_proto_size.py b/src/mapi/glapi/gen/glX_proto_size.py
> index b008e9d..4598f61 100644
> --- a/src/mapi/glapi/gen/glX_proto_size.py
> +++ b/src/mapi/glapi/gen/glX_proto_size.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/glX_server_table.py b/src/mapi/glapi/gen/glX_server_table.py
> index 5e996eb..7f3cc41 100644
> --- a/src/mapi/glapi/gen/glX_server_table.py
> +++ b/src/mapi/glapi/gen/glX_server_table.py
> @@ -1,6 +1,7 @@
>  #!/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2005, 2006
> +# © Copyright IBM Corporation 2005, 2006
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_SPARC_asm.py b/src/mapi/glapi/gen/gl_SPARC_asm.py
> index 89bccef..3306576 100644
> --- a/src/mapi/glapi/gen/gl_SPARC_asm.py
> +++ b/src/mapi/glapi/gen/gl_SPARC_asm.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004
> +# © Copyright IBM Corporation 2004
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
> index 8c622aa..71b0b62 100644
> --- a/src/mapi/glapi/gen/gl_XML.py
> +++ b/src/mapi/glapi/gen/gl_XML.py
> @@ -1,6 +1,8 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# Copyright © IBM Corporation 2004, 2005
> +# Copyright © Intel Corporation 2016
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_apitemp.py b/src/mapi/glapi/gen/gl_apitemp.py
> index 50a599a..9a695cb 100644
> --- a/src/mapi/glapi/gen/gl_apitemp.py
> +++ b/src/mapi/glapi/gen/gl_apitemp.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_enums.py b/src/mapi/glapi/gen/gl_enums.py
> index 49cc0bd..c4e1691 100644
> --- a/src/mapi/glapi/gen/gl_enums.py
> +++ b/src/mapi/glapi/gen/gl_enums.py
> @@ -1,8 +1,9 @@
>  #!/usr/bin/python2
> +# encoding=utf-8
>  
> -# (C) Copyright Zack Rusin 2005. All Rights Reserved.
> -# Copyright (C) 2015 Intel Corporation
> -# Copyright (C) 2015 Broadcom Corporation
> +# © Copyright Zack Rusin 2005. All Rights Reserved.
> +# Copyright © 2015 Intel Corporation
> +# Copyright © 2015 Broadcom Corporation
>  # 
>  # Permission is hereby granted, free of charge, to any person obtaining a
>  # copy of this software and associated documentation files (the "Software"),
> diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
> index 4f86bcf..9374f41 100644
> --- a/src/mapi/glapi/gen/gl_genexec.py
> +++ b/src/mapi/glapi/gen/gl_genexec.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# Copyright (C) 2012 Intel Corporation
> +# Copyright © 2012 Intel Corporation
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
>  # copy of this software and associated documentation files (the "Software"),
> diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py
> index 3ca89cd..45c9e47 100644
> --- a/src/mapi/glapi/gen/gl_gentable.py
> +++ b/src/mapi/glapi/gen/gl_gentable.py
> @@ -1,8 +1,9 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> -# (C) Copyright Apple Inc. 2011
> -# Copyright (C) 2015 Intel Corporation
> +# © Copyright IBM Corporation 2004, 2005
> +# © Copyright Apple Inc. 2011
> +# Copyright © 2015 Intel Corporation
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_procs.py b/src/mapi/glapi/gen/gl_procs.py
> index 685e2fa..8dd90c8 100644
> --- a/src/mapi/glapi/gen/gl_procs.py
> +++ b/src/mapi/glapi/gen/gl_procs.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py
> index e25971a..aba3d33 100644
> --- a/src/mapi/glapi/gen/gl_table.py
> +++ b/src/mapi/glapi/gen/gl_table.py
> @@ -1,8 +1,9 @@
>  #!/usr/bin/python2
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004
> +# © Copyright IBM Corporation 2004
>  # All Rights Reserved.
> -# Copyright (c) 2014 Intel Corporation
> +# Copyright © 2014 Intel Corporation
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
>  # copy of this software and associated documentation files (the "Software"),
> diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py
> index d367feb..89fabaf 100644
> --- a/src/mapi/glapi/gen/gl_x86-64_asm.py
> +++ b/src/mapi/glapi/gen/gl_x86-64_asm.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2005
> +# © Copyright IBM Corporation 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
> index 1a0c0f4..a470d27 100644
> --- a/src/mapi/glapi/gen/gl_x86_asm.py
> +++ b/src/mapi/glapi/gen/gl_x86_asm.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2004, 2005
> +# © Copyright IBM Corporation 2004, 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/license.py b/src/mapi/glapi/gen/license.py
> index 0218164..c7d9451 100644
> --- a/src/mapi/glapi/gen/license.py
> +++ b/src/mapi/glapi/gen/license.py
> @@ -1,4 +1,6 @@
> -# (C) Copyright IBM Corporation 2004
> +# encoding=utf-8
> +
> +# © Copyright IBM Corporation 2004
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> diff --git a/src/mapi/glapi/gen/remap_helper.py b/src/mapi/glapi/gen/remap_helper.py
> index 31a6fe4..5103b41 100644
> --- a/src/mapi/glapi/gen/remap_helper.py
> +++ b/src/mapi/glapi/gen/remap_helper.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# Copyright (C) 2009 Chia-I Wu <olv at 0xlab.org>
> +# Copyright © 2009 Chia-I Wu <olv at 0xlab.org>
>  # All Rights Reserved.
>  #
>  # This is based on extension_helper.py by Ian Romanick.
> diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
> index 142c503..34ed57c 100644
> --- a/src/mapi/glapi/gen/static_data.py
> +++ b/src/mapi/glapi/gen/static_data.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# Copyright (C) 2015 Intel Corporation
> +# Copyright © 2015 Intel Corporation
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
>  # copy of this software and associated documentation files (the "Software"),
> diff --git a/src/mapi/glapi/gen/typeexpr.py b/src/mapi/glapi/gen/typeexpr.py
> index af48fee..9397c94 100644
> --- a/src/mapi/glapi/gen/typeexpr.py
> +++ b/src/mapi/glapi/gen/typeexpr.py
> @@ -1,6 +1,7 @@
>  #!/usr/bin/env python
> +# encoding=utf-8
>  
> -# (C) Copyright IBM Corporation 2005
> +# © Copyright IBM Corporation 2005
>  # All Rights Reserved.
>  #
>  # Permission is hereby granted, free of charge, to any person obtaining a
> 



More information about the mesa-dev mailing list