You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2020/08/27 11:36:43 UTC

[flink] 01/03: [hotfix][docs] Enforce reading files in UTF-8 in include_without_header.rb

This is an automated email from the ASF dual-hosted git repository.

dwysakowicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 9778f37fa4a05c6a243da61ace8de1a2b0e32b54
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Thu Aug 27 13:30:41 2020 +0200

    [hotfix][docs] Enforce reading files in UTF-8 in include_without_header.rb
    
    All our documentation pages are encoded in UTF-8. However if not
    specified, File.read will use the system default encoding. Therefore
    making it impossible to build docs in a system with a different default
    encoding. It is the case e.g. when building docs through the docker
    container.
---
 docs/_plugins/include_without_header.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/_plugins/include_without_header.rb b/docs/_plugins/include_without_header.rb
index 200a401..8a7792e 100644
--- a/docs/_plugins/include_without_header.rb
+++ b/docs/_plugins/include_without_header.rb
@@ -28,7 +28,7 @@ module Jekyll
       def render(context)
         source = File.expand_path(context.registers[:site].config['source'])
         path = File.join(source, @file)
-        content = File.read(path)
+        content = File.read(path, :encoding => 'UTF-8')
         content = content.split(/<!--[^>]*LICENSE-2.0[^>]*-->/, 2)[1]
         partial = Liquid::Template.parse(content)
         partial.render!(context)