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

How to support Chinese? #478

Closed
xunx-i opened this issue Oct 22, 2020 · 3 comments
Closed

How to support Chinese? #478

xunx-i opened this issue Oct 22, 2020 · 3 comments

Comments

@xunx-i
Copy link

xunx-i commented Oct 22, 2020

Description

How to support Chinese?

Steps to Reproduce

  1. Register a new user
  2. Connect to server socket
  3. Send message to fetch current user's friends
  4. Receive a message

Expected Result

displays "???" when the message received is have Chinese.

Context

//Callback
OnChannelMessageCallbackEvent(const NChannelMessage& message)
{
FString JsonValue = FString(message.content.c_str());
// JsonValue displays "???" when the message received is have Chinese.
}

  • Unreal C++

Your Environment

  • Nakama: 2.12.0
  • Database: v19.2.5
    -Unreal : 4.25.3
@novabyte
Copy link
Member

@LinXunxi I don't think this is an issue with the server but could be a problem with how UTF-8 is handled in the Unreal C++ client. I'll leave this open but will also open an issue to track the problem on the client SDK.

@xunx-i
Copy link
Author

xunx-i commented Oct 23, 2020

@LinXunxi I don't think this is an issue with the server but could be a problem with how UTF-8 is handled in the Unreal C++ client. I'll leave this open but will also open an issue to track the problem on the client SDK.

So do I have to change the message encoding to UTF-8?

@xunx-i
Copy link
Author

xunx-i commented Oct 23, 2020

@LinXunxi I don't think this is an issue with the server but could be a problem with how UTF-8 is handled in the Unreal C++ client. I'll leave this open but will also open an issue to track the problem on the client SDK.

ok, it can do, think.

now code :
Send:
RtClientPtr->writeChatMessage(TCHAR_TO_UTF8(*channel),TCHAR_TO_UTF8(*message).......);
Receive:
FString JsonValue = FString(UTF8_TO_TCHAR(message.content.c_str()));

@xunx-i xunx-i closed this as completed Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants