Giter Club home page Giter Club logo

Comments (2)

iamstolis avatar iamstolis commented on June 19, 2024

I am sorry, I am not able to reproduce this issue. I see the expected output. Have you tried to set name and password properties of RegisterUserReq (and print the output of UserService.register()) using pure Java (i.e. without the usage of JavaScript)? Does it print the expected output or is it garbled as well? I am curious if the issue is really caused by GraalVM or whether it is some issue of the tool that you use to display the test results.

from graaljs.

RekaDowney avatar RekaDowney commented on June 19, 2024

@iamstolis Oh, thank you for reminding me, I quickly checked the breakpoint and found that the code was indeed correct during execution, but the output was garbled.
image

Then I looked at all the encoding configurations of IDEA and found that they were all UTF-8. I tried to add -Dfile.encoding=UTF-8 and -Dconsole.encoding=UTF-8 VM options for IDEA, but it was useless at all, whether restart IDEA or restart the computer.
image

Just when I was frustrated, I thought about whether System.out had changed, and found that charset had indeed changed (it did not use the charset specified by -Dfile.encoding, but followed the default charset of the operating system) . I then changed the charset via the System.setOut method and it finally worked.
image

Finally, I continued to search and found that this is a bug of JDK19. The official provides a new -Dstdout.encoding=UTF-8 property to control the charset of System.out. See here.

Thanks :)

from graaljs.

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.