Giter Club home page Giter Club logo

Comments (11)

kongfei605 avatar kongfei605 commented on September 14, 2024

感谢反馈,这个问题我来看看

from categraf.

zhanglingxing avatar zhanglingxing commented on September 14, 2024

@kongfei605 我发现脚本有中文注释,脚本是可以正常执行的,但是server的状态也是running,然后timeout。
image

错误日志和之前的一样
image

from categraf.

UlricQin avatar UlricQin commented on September 14, 2024

数据库里的 task_xx 那一百张表,用的是什么字符集?

from categraf.

zhanglingxing avatar zhanglingxing commented on September 14, 2024

@UlricQin
数据库表的编码
image

数据库的编码
image

mysql连接串的配置
image

from categraf.

UlricQin avatar UlricQin commented on September 14, 2024

那不清楚了,按理说就是字符集的问题:

image

from categraf.

zhanglingxing avatar zhanglingxing commented on September 14, 2024

@UlricQin 大佬,那你们有没有测试过,在windows执行对应的脚本,脚本中包含中文,如果你们是可以的,我再排查一下环境。

from categraf.

UlricQin avatar UlricQin commented on September 14, 2024

from categraf.

UlricQin avatar UlricQin commented on September 14, 2024

我手头有个 Macbook,在 Mac 上使用容器运行整套环境,可以正常看到脚本输出的中文:

image

from categraf.

zzmark avatar zzmark commented on September 14, 2024

cmd 脚本没法用 UTF-8编码,这方面要做些特殊处理

from categraf.

zzmark avatar zzmark commented on September 14, 2024

反馈的 issue 包含两个问题

  1. task#start() 阶段,若是出现 error,没有正确设置 status,任务仍被识别为 running
  2. cmd 运行脚本,需要使用 ANSI 编码 + CRLF 换行。golang 内部均为unicode编码,没中文的话 utf8 与 ANSI 在 ASCII 范围内一致所以没问题。

这问题不算难搞,稍后我提个patch

其实还有个问题,脚本传入换行为 LF,应该会出现吞命令的,但是你这个却没出现,有点意外,这个脚本难道是从外部粘贴进来的吗?
如果是这样,n9e那边的编辑器需要补个换行符过滤了,避免 Linux 脚本出现 CRLF 导致无法执行。

若是改用 powershell(pwsh),则可以使用utf-8 + LF,不过改造工程有点大,需要n9e也加表单加字段,链路较长

from categraf.

kongfei605 avatar kongfei605 commented on September 14, 2024

golang 会自动处理windows和linux的换行差异

from categraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.