Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: invalid byte sequence in UTF-8 #37

Open
RunningYoung opened this issue Jun 5, 2019 · 24 comments
Open

error: invalid byte sequence in UTF-8 #37

RunningYoung opened this issue Jun 5, 2019 · 24 comments
Labels

Comments

@RunningYoung
Copy link

No description provided.

@dblock
Copy link
Owner

dblock commented Jun 5, 2019

Please provide a file/repro @RunningYoung ? Thanks

@dblock dblock added the bug? label Jun 5, 2019
@WeijunDeng
Copy link

me too

2 similar comments
@jiehailong
Copy link

me too

@zhongqing05
Copy link

me too

@wujiegoodluck
Copy link

error: invalid byte sequence in UTF-8

@dblock
Copy link
Owner

dblock commented Dec 30, 2019

@wujiegoodluck @zhongqing05 @jiehailong @WeijunDeng someone please add a test with a repro,

@IDwangluting
Copy link

me too

@UknowHui
Copy link

+1

@dblock
Copy link
Owner

dblock commented Jan 20, 2020

To the next person about to add a +1:

  1. Write a test that reproduces the problem.
  2. Fix the problem.
  3. Submit a PR.

@xiaoyaoknight
Copy link

xiaoyaoknight commented Apr 17, 2020

me too
error: invalid byte sequence in UTF-8

My project has some .rb files , I don't know if it's because of that。

@dblock
Copy link
Owner

dblock commented Apr 17, 2020

@xiaoyaoknight Can you please post a file at least with which this can be reproduced?

@wuyj
Copy link

wuyj commented Apr 25, 2020

Checking derivedData/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ZHTableview.build/DerivedSources/ZHTableview-Swift.h ...
Checking derivedData/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ZHTableview.build/Objects-normal/x86_64/ZHTableview-Swift.h ...
Checking derivedData/Build/Intermediates.noindex/PrecompiledHeaders/DDMall-Bridging-Header-swift_3K0PQHEOM6MA9-clang_2A97GP9MCLM9K.pch ...
error: invalid byte sequence in UTF-8

@dblock
My project is swift and oc mixed mode, the project directory execution fui -v find reported this error

@dblock
Copy link
Owner

dblock commented Apr 25, 2020

@wuyj Can you please upload the last file, derivedData/Build/Intermediates.noindex/PrecompiledHeaders/DDMall-Bridging-Header-swift_3K0PQHEOM6MA9-clang_2A97GP9MCLM9K.pch somewhere (or add a unit test with this file and PR it)?

@tepmnthar
Copy link

tepmnthar commented Aug 5, 2020

Let me end this thread. This is caused by the non-UTF-8 encoding system, such as GB18013 which may be default Chinese Encoding System on Windows. You should reopen those files with the correct encoding system and then save it in UTF-8.

Don't know how to solve it with code. @dblock

编码错了,这些有问题的文件都是 GB18013 格式的,手动转成 UTF-8 就好了,具体是哪个文件用 --verbose 看,转的话 VSCode 就可以。转完了再跑就行了

Sample files:

SampleFiles.zip

@dblock
Copy link
Owner

dblock commented Aug 5, 2020

@tepmnthar I can take a stab at adding support for this in fui. I think we should at least handle the error gracefully by showing which file is problematic. We could also detect what encoding the file is in. Turn your sample into a spec to start?

@tepmnthar
Copy link

Glad to hear that! @dblock
It's difficult for me to write a long paragraph in English. It may cause misunderstanding. Would help if you need to translate it to Chinese.

@elderJiang
Copy link

me too

@siyou325
Copy link

QR_Encode.h.zip
@dblock this file causes error: invalid byte sequence in UTF-8

@dblock
Copy link
Owner

dblock commented Dec 16, 2020

@siyou325 Thanks, please turn this into a spec and a fix.

@siyou325
Copy link

@dblock I'm sorry for that i can't help you,because i just try fui and found this error😊

@doubleJJJJ
Copy link

I also encountered the same problem, is there a solution?

@doubleJJJJ
Copy link

Let me end this thread. This is caused by the non-UTF-8 encoding system, such as GB18013 which may be default Chinese Encoding System on Windows. You should reopen those files with the correct encoding system and then save it in UTF-8.

Don't know how to solve it with code. @dblock

编码错了,这些有问题的文件都是 GB18013 格式的,手动转成 UTF-8 就好了,具体是哪个文件用 --verbose 看,转的话 VSCode 就可以。转完了再跑就行了

Sample files:

SampleFiles.zip

这个这个问题现在是怎么解决呢?

@schriftgestalt
Copy link

It would be useful if the error message would mention the file that contains the error.

@songgeb
Copy link

songgeb commented Jan 19, 2024

该问题我也遇到过,解决办法是,打开文件,按照UTF-8编码重新保存下即可。至于如何找到哪个文件编码有错误,可以使用fui -v命令,命令遇到有问题的文件时会停止执行

另外,我建议熟悉Ruby语法的朋友可以抽空修复下该问题提一个pr,不要总是依赖作者,作者的工作环境可能根本接触不到非UT-8的编码。大家要多一些开源分享意识

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests