Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved How does the Dedicated Server's console app print utf8 string? like Chinese word.

Discussion in 'Dedicated Server' started by Minglinaaaaaa, May 19, 2023.

  1. Minglinaaaaaa

    Minglinaaaaaa

    Joined:
    Feb 3, 2015
    Posts:
    5
    Hello, I build Deciated Server from my project. When I running this console app, I found the app printf string were messy code all.
    So how can I fix it?
     

    Attached Files:

  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    435
    Hi @Minglinaaaaaa , given that the "Progress" part of your string is in english, I think the rest of your string is encoded the wrong way. Can you please post the code that prints these messages?
     
  3. Minglinaaaaaa

    Minglinaaaaaa

    Joined:
    Feb 3, 2015
    Posts:
    5
    Hi, @RikuTheFuffs-U , Thank you for you reply.
    I want to print Chinese and I tried serveral ways. but it was failed at all. There is my code and result.
     

    Attached Files:

  4. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    435
    Are you 100% sure the terminal you're using to run the console app supports printing these characters? AFAIK, Windows CMD has problems with it.
     
  5. Minglinaaaaaa

    Minglinaaaaaa

    Joined:
    Feb 3, 2015
    Posts:
    5
    Yes, I tried to create a console app from visual studio and runned it, it seemed everything is well. You can see the picture.
     

    Attached Files:

  6. Minglinaaaaaa

    Minglinaaaaaa

    Joined:
    Feb 3, 2015
    Posts:
    5
    @RikuTheFuffs-U I tried to compare to what different between these two app. then, I found one of these app's property is different. the property is Language. you can see the picture to find it.
     

    Attached Files:

  7. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    435
    ok, so it could be a locale-related setting? Anyway it doesn't look like something related specifically to the dedicated server
     
  8. Minglinaaaaaa

    Minglinaaaaaa

    Joined:
    Feb 3, 2015
    Posts:
    5
    Yes, I think that it's a local-related setting with the build app from dedicated server.
    And I found the other way to fix it. I created a .bat file and used "chcp 65001" command, then running the dedicated server app on windows 10, It seems everything is OK. You can see the picture.
    I think this problem were solved if it has any way to changes the active console code page.
     

    Attached Files: