Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad encoding in GitLab CI output

I am just learning something about GitLab CI. I have GitLab Runner running on my local machine successfully connected to my GitLab project. The commands I have written work well but if there is some output in the console with non asci characters, the output in Gitlab shows � characters.

Win10 Pro with Czech localization (corporate machine)

My .gitlab-ci.yml file:

variables:
  PROJECT_FOLDER: 'Code'
  PROJECT_NAME: 'Apps.InfoPanels.Cloud.WebApp'

  TEST_FOLDER: 'Apps.InfoPanels.Cloud.Test'
  TEST_NAME: 'Apps.InfoPanels.Cloud.Test'

  NUGET_PATH: 'C:\NuGet\nuget.exe'
  MSBUILD_PATH: 'C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe'
  COREBUILD_PATH: 'C:\Program Files\dotnet\dotnet.exe'
  NUNIT_PATH: 'C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe'

stages:
  - build

before_script:
  - 'tree'

build:
  stage: build
  script:
    - '& "$env:MSBUILD_PATH" /p:Configuration=Debug ".\$env:PROJECT_FOLDER\$env:PROJECT_NAME.sln"'
  artifacts:
    untracked: true

And config.toml:

concurrent = 1
check_interval = 0

[[runners]]
  name = "sykora-nb"
  url = "URL"
  token = "TOKEN"
  executor = "shell"
  builds_dir = "C:/GitLab-Runner/builds"
  shell = "powershell"
  [runners.cache]

Is there some magic setting I've missed?

For example I used the tree command GitLab CI ooutput screen

like image 373
Ondřej Sýkora Avatar asked Jan 09 '18 13:01

Ondřej Sýkora


1 Answers

Try to add something like

before_script:
  - CHCP 65001

65001 is UTF-8 encoding

like image 180
user1624251 Avatar answered Oct 20 '22 17:10

user1624251