Simcenter STAR-CCM+ Cause of the message "latin-1 encoding error" and how to resolve it

2022-12-20T01:23:47.000-0500
Simcenter STAR-CCM+ Simcenter STAR-CCM+ Virtual Reality Teamcenter Share Simcenter Cloud HPC Simcenter STAR-CCM+ Viewer Simcenter STAR-CCM+ Application Specific Solutions

요약

Solution of the latin-1 encoding error like below message: 'latin-1' codec can't encode characters in position 0-2: ordinal not in range(256)


세부 정보

STAR-CCM+는 기본적으로 OS language를 default로 설정하기 때문에 OS language와 호환성이 좋은 편이다.
하지만 Design Manager와 같은 모듈 프로그램을 실행할 때, latin-1 encoding error와 같이 encoding 에러가 발생하는 경우 이에 대한 원인과 해결 방법에 대해서 알아보고자 한다.

1. Error message
 1) latin-1 encoding error가 발생하는 경우 아래 그림과 같이 error mesaage가 출력된다.
 2) 해당 이미지는 STAR-CCM+는 정상적으로 사용 가능하나 Design manager를 실행할 때 에러가 발생했다.

image.png

2. 원인 및 해결방법
 1) 파일 경로 
   원인: 파일 경로 중 한글 이름으로 만들어진 폴더가 있거나 특수문자가 있는 경우
   해결: 높은 확률로 한글 혹은 특수문자가 인코딩 에러의 원인이므로 영어를 사용하는 것을 권장
 
 2) command option
  원인: 특정 command option으로 인해 encoding error가 발생하는 경우
  해결: 하기 이미지의 locale command 적용
           (* command 입력 방법은 STAR-CCM+ RMB 속성 > 대상에 그림과 같이 입력)         

      image.png  image.png

 3) Python version
  원인: STAR-CCM+ 설치 경로에 설치된 파이썬과 OS에 설치된 파이썬 version 검토 
          (ex. C:\Python vs. C:\<Star install dir>\star\lib\python)    
  해결: 각 파이썬의 version이 다른 경우 동일 version으로 설치

 4) encoding 확인
  원인: command prompt에서 <star install dir>\star\lib\python 경로로 이동 후 
          import sys; print(sys.stdin.encoding, sys.stdout.encoding) 입력하여 utf-8 utf-8이 출력되는지 확인
  해결: utf-8이 출력되지 않으면, 2) command 활용

image.png

본 게시글에서 언급한 latin-1 encoding error는 pc host name이 한글로 설정되어 있어서 발생한 에러로 확인되어 영문으로 변경하여 에러를 해결한 케이스 입니다. 위와 같은 원인 이외에도 encoding error는 다양한 원인에 의해서 발생할 수 있기 때문에 위와 같은 방법으로 해결되지 않는 경우 Support Center에 case를 만들어서 내용을 공유하거나 담당 엔지니어에게 연락을 취해 같이 방법을 찾는 것을 권장합니다.

 

KB 자료 ID# KB000069432_KO

내용

요약세부 정보

관련 구성 요소

Design Manager Electronics Cooling In-Cylinder (STAR-ICE) Job Manager Simcenter STAR-CCM+