openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

Encoding issue with Windows-1252 when building project

Open tgolob opened this issue 3 years ago • 0 comments

I am encountering an encoding issue when trying to build the openai-java project using Intellij 2023.1, open JDK 17 (Amazon Corretto version 17.0.6), and Windows 11 Pro (OSArchitecture: 64-bit, BuildNumber: 22621).

When building the project, I get error messages related to unmappable characters for encoding windows-1252. For instance:

C:\Users\user\IdeaProjects\openai-java\api\src\main\java\com\theokanning\openai\completion\chat\ChatMessage.java:9: error: unmappable character (0x9D) for encoding windows-1252 Each object has a role (either “system�, “user�, or “assistant�) and content (the content of the message). Conversations can be as short as 1 message or fill many pages.

It seems that the issue is related to special characters in the source files not being correctly interpreted by the windows-1252 encoding.

Solution: replace problematic quotations with windows-1252 encoding standard double quotation character

tgolob avatar Apr 07 '23 21:04 tgolob