Comments (11)
确实需要做兼容,你提个 pr 过来。
from fis-command-release.
toEncoding
应该返回 string
,不然整个从逻辑上就有问题了。正在看iconv-lite
是否支持toString
某一个特定编码。
from fis-command-release.
这里不能用字符的,只能是二进制流,类似的问题我有遇到过
24b55dc#diff-eff50028862616c28af389bc1a879f9bR89
你上次修复的时候加的这句话导致的这个问题,不能setContent,因为每个release的replace都是独立的,不应该记录在文件中,所以接口才会把file和content分开传入。
Javascript中字符串只有UTF8字符集,其余编码的字符只能用二进制存储。
from fis-command-release.
本身 string
被搞成了 buffer
,本身从逻辑上就有问题,这算是一个坑,而且这个坑很容易踩到。
from fis-command-release.
fis.util.read()
对非 utf8
编码的文本文件返回 Buffer
对象而非 String
应该是因为 nodejs
本身就无法直接表示 GBK 的字符串吧。
from fis-command-release.
@yanni4night 嗯,是的。所以要借助外部库来实现,还未证实能否实现。可想,这块确实挺坑。
from fis-command-release.
@hefangshi 现在这种实现下,replace
的过程会被一遍又一遍的过?比如我经过俩 deploy
?我没有尝试过放多个 deploy
的情况。
from fis-command-release.
@xiangshouding 是的,因为每个deploy都有独立的replace设置,所以每个deploy都需要独立的进行replace,并且由于Javascript中的字面量也只有UTF8编码格式,因此编码转换也必须每次独立执行,才能进行正确的replace。
这个issue的触发原因实际上也是release了两个以上的deploy,并且编码是GBK导致的。我上次做deploy插件化也踩了一模一样的坑,直接setContent了,是贴吧的同学反馈的。
from fis-command-release.
嗯,好的,我先暂且删掉修复一把。
from fis-command-release.
#diff-eff50028862616c28af389bc1a879f9bR55 这里进入判断分支的时候如果charset不是utf8的话content理论上一定是 Buffer
,是不是还有crash的危险
from fis-command-release.
不setContent的话是没问题的
from fis-command-release.
Related Issues (12)
- 为usePolling添加一个自动探测功能,如果原生方法失败则自动开启轮询模式
- 我将receiver.php文件放到了我本地的一个服务器上 然后上传 出现了如下错误 该咋办 HOT 13
- 增加 --msg HOT 8
- receiver.php 这个文件有java版的吗?求 HOT 2
- 需要升级文件监听模块 chokidar 至最新版 HOT 5
- 请问向 reciever.php 上传是走 http 协议吗?
- 提交到远端服务器报错了 HOT 1
- 按照API上来的为什么上传不成功呢
- 在watch中的opt.srcCache是否是多余的
- fis2上传文件到服务器死活上传不了 HOT 4
- 有node版本的不
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fis-command-release.