windows上cli 处理文件编码问题
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- cli, operating-systems
Research direction
Reproduce the java -jar ... checkstyle command in Windows cmd with the UTF-8 openapi.yml, first comparing behavior with and without -Dfile.encoding=UTF-8. Trace the failure from ToolkitMain.main into CheckStyleBase.run; done means the CLI processes Chinese UTF-8 input without requiring the JVM encoding flag.
Written by the indexing model from the issue text.
Description
openapi yaml 文件有中文字符,文件编码格式是 utf-8 。当在windows cmd 下执行时会提示编码错误,需要加上 -Dfile.encoding=UTF-8。
错误信息如下:
`java -jar bin/cli-0.2.0-SNAPSHOT.jar checkstyle -r style-check-rules.properties -f openapi.yml
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.RuntimeException: java.io.CharConversionException: Invalid UTF-8 start byte 0xb5 (at char #35, byte #-1)
at [Source: (byte[])"openapi: '3.0.2'
info:
title: ?????POS???
version: '1.0.0'
description: ???POS???????
servers:
- url: 'https://xxxxxxxx'
description: ???????????????
- url: http://xxxxxxxxxx/{basePath}
description: ?????????????
variables:
basePath:
default: v2
description: api version
paths:
/pos/login.init:
$ref: commonapi.yml#/components/login.init
/pos/login:
$ref: commonapi.yml#/compo"[truncated 1336 bytes]; line: 1, column: 1]
at org.apache.servicecomb.toolkit.cli.CheckStyleBase.run(CheckStyleBase.java:84)
at org.apache.servicecomb.toolkit.cli.ToolkitMain.main(ToolkitMain.java:48)
... 8 more
make: *** [Makefile:28: verify] Error 1`
- Dominant language
- Java
- Stars
- 440
- Forks
- 35
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/servicecomb-toolkit
-
编译出现问题,看不懂错误信息Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/servicecomb-toolkit#85 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
支持通过网站页面生成工程模板Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
遗留应用代码生成微服务工程Open
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/servicecomb-toolkit#47 · 3 comments ·
All issues in apache/servicecomb-toolkit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
grimmory-tools/grimmory#2850 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
aoqia194/leaf-loader#19 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/streampark#4521 ·
-
Update license yearOpen0 - Backlog 1 - Ready documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100