# Character encoding problem to use Send a signal API

**URL:** <https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [June 9, 2021, 2:17am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116 "2021-06-09T02:17:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![es-hur](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@es-hur](https://openvidu.discourse.group/u/es-hur)\
**Post date:** [June 9, 2021, 2:17am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/1 "2021-06-09T02:17:41Z")

</div>

Hi!

I use Send a signal to a Session REST API and record chat conversation using custom-layout.  
but When using the East Asian character set, the character “???” A phenomenon has occurred.

version info : openvidu server 2.18

- send signal event(REST API call “POST /openvidu/api/signal”) : sending data “data”:“signal シグナル 시그널 信号”

curl -u OPENVIDUAPP:MY\_SECRET -d ‘{“session”:“ses\_YnDaGYNcd7”,“to”: [“con\_Xnxg19tonh”, “con\_TNVdbuQCJF”],“type”:“MY\_TYPE”,“data”:“signal シグナル 시그널 信号”}’ -H “Content-Type: application/json;charset=utf-8” -X POST [http://127.0.0.1:5443/openvidu/api/signal](http://127.0.0.1:5443/openvidu/api/signal)

- server log : character “???” A phenomenon has occurred

[INFO] 2021-06-09 00:34:33,932 [http-nio-0.0.0.0-5443-exec-4] io.openvidu.server.rest.SessionRestController - REST API: POST /openvidu/api/signal {session=ses\_YnDaGYNcd7, to=[con\_Xnxg19tonh, con\_TNVdbuQCJF], type=MY\_TYPE, data=signal ??? ??? ???}

and record chat conversation using custom-layout

- screen capture : chat conversation recording file character encoding error

 ![capture111](https://global.discourse-cdn.com/free1/uploads/openvidu/original/2X/4/4a627d54d21b09e75051d71bfab83d21cce74527.jpeg)

- front app code : using openvidu-browser 2.18

sendMessage(message: string) {  
message = message.replace(/ +(?= )/g, ‘’);  
if (message !== ‘’ && message !== ’ ') {  
const data = {  
message: message,  
nickname: this.oVSessionService.getWebcamUserName()  
};  
const sessionAvailable = this.oVSessionService.getConnectedUserSession();  
sessionAvailable.signal({  
data: JSON.stringify(data),  
to: this.to,  
type: this.signal  
});  
}  
}

- server log : character “???” A phenomenon has occurred

[INFO] 2021-06-09 01:13:50,890 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.rpc.RpcHandler - Participant con\_GbeaPEcjRQ is calling method ‘signal’ in session roomA  
[INFO] 2021-06-09 01:13:50,891 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.cdr.CDRLoggerFile - {“signalSent”:{“sessionId”:“roomA”,“uniqueSessionId”:“roomA\_1623201025049”,“timestamp”:1623201230891,“from”:“con\_GbeaPEcjRQ”,“to”:[“con\_Fcc21sDvIR”,“con\_GbeaPEcjRQ”,“RECORDER”],“type”:“chat”,“data”:"{“message”:“signal”,“nickname”:“teacher”}"}}  
[INFO] 2021-06-09 01:14:26,749 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.rpc.RpcHandler - Participant con\_GbeaPEcjRQ is calling method ‘signal’ in session roomA  
[INFO] 2021-06-09 01:14:26,752 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.cdr.CDRLoggerFile - {“signalSent”:{“sessionId”:“roomA”,“uniqueSessionId”:“roomA\_1623201025049”,“timestamp”:1623201266752,“from”:“con\_GbeaPEcjRQ”,“to”:[“con\_Fcc21sDvIR”,“con\_GbeaPEcjRQ”,“RECORDER”],“type”:“chat”,“data”:"{“message”:"??? “,“nickname”:“teacher”}”}}  
[INFO] 2021-06-09 01:14:37,703 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.rpc.RpcHandler - Participant con\_GbeaPEcjRQ is calling method ‘signal’ in session roomA  
[INFO] 2021-06-09 01:14:37,704 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.cdr.CDRLoggerFile - {“signalSent”:{“sessionId”:“roomA”,“uniqueSessionId”:“roomA\_1623201025049”,“timestamp”:1623201277704,“from”:“con\_GbeaPEcjRQ”,“to”:[“con\_Fcc21sDvIR”,“con\_GbeaPEcjRQ”,“RECORDER”],“type”:“chat”,“data”:"{“message”:"??? “,“nickname”:“teacher”}”}}  
[INFO] 2021-06-09 01:14:43,386 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.rpc.RpcHandler - Participant con\_GbeaPEcjRQ is calling method ‘signal’ in session roomA  
[INFO] 2021-06-09 01:14:43,387 [SessionHandler-oe8p6oh7u0aihahms8ae6njh2q-e4-t0] io.openvidu.server.cdr.CDRLoggerFile - {“signalSent”:{“sessionId”:“roomA”,“uniqueSessionId”:“roomA\_1623201025049”,“timestamp”:1623201283387,“from”:“con\_GbeaPEcjRQ”,“to”:[“con\_Fcc21sDvIR”,“con\_GbeaPEcjRQ”,“RECORDER”],“type”:“chat”,“data”:"{“message”:"??",“nickname”:“teacher”}"}}

Is there any solution that with some OpenVidu Server configuration ?

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 9, 2021, 10:25am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/2 "2021-06-09T10:25:54Z")

</div>

Hi,

In version 2.18.0 we updated all character encodings to UTF-8 on openvidu-server. This encoding should support what I think it is Korean (sorry if I’m mistaken, I am not well versed in Asian languages).  
This is OpenVidu Call application 2.18.0 against OpenVidu Server 2.18.0:

 ![image (32)](https://global.discourse-cdn.com/free1/uploads/openvidu/original/2X/c/c9a96b327aacb0576f94672bd11ccf883716b960.png)

As you can see the message travels without a problem end-to-end.  
It is true that openvidu-server logs this message:

```auto
[INFO] 2021-06-09 10:19:19,261 [https-jsse-nio-0.0.0.0-4443-exec-10] io.openvidu.server.rest.SessionRestController - REST API: POST /openvidu/api/signal {session=institutional-green-donkey, to=[], data=signal ???? ??? ??}

```

But that’s probably a problem with the logging operation itself, and it does not seem to affect the final message sent to the participants.

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 9, 2021, 10:32am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/3 "2021-06-09T10:32:52Z")

</div>

I have also been testing the CDR and WebHook with your custom message and I received it no problem:

```json
{"signalSent":{"sessionId":"TestSession","uniqueSessionId":"TestSession_1623234638137","timestamp":1623234665564,"from":null,"to":["con_VtqVLvCXQd"],"type":null,"data":"signal シグナル 시그널 信号"}}

```

---

<div class="post-metadata">

**Author:** ![es-hur](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@es-hur](https://openvidu.discourse.group/u/es-hur)\
**Post date:** [June 10, 2021, 12:54am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/4 "2021-06-10T00:54:36Z")

</div>

I’ve seen messages pass end-to-end without problems, but problem with the logging operation.

I am also composed recording chat conversations using custom-layout.

- version : openvidu server 2.18
- outputMode : COMPOSED

But there is a problem with the recording file.

There is an problem displaying the character.

- record file screen capture : occurred encoding Problems  

- mp4 file : [mp4 file link](https://drive.google.com/file/d/1m7g2fAgB1kYM31rwNq80Is6tdR2gDBKG/view?usp=sharing)

- chrome\_debug.log

[81:81:0610/043206.304276:INFO:CONSOLE(172876)] “Received request: {“method”:“sendMessage”,“params”:{“data”:”{“message”:“signal”,“nickname”:“teacher”}",“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}}", source: (172876)  
[81:81:0610/043206.304357:INFO:CONSOLE(172888)] “New signal: {“data”:”{“message”:“signal”,“nickname”:“teacher”}",“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}", source: (172888)

[81:81:0610/043211.030850:INFO:CONSOLE(172876)] “Received request: {“method”:“sendMessage”,“params”:{“data”:”{“message”:“シグナル “,“nickname”:“teacher”}”,“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}}”, source: (172876)  
[81:81:0610/043211.030885:INFO:CONSOLE(172888)] “New signal: {“data”:”{“message”:“シグナル “,“nickname”:“teacher”}”,“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}”, source: (172888)

[81:81:0610/043216.183982:INFO:CONSOLE(172876)] “Received request: {“method”:“sendMessage”,“params”:{“data”:”{“message”:“시그널”,“nickname”:“teacher”}",“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}}", source: (172876)  
[81:81:0610/043216.184021:INFO:CONSOLE(172888)] “New signal: {“data”:”{“message”:“시그널”,“nickname”:“teacher”}",“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}", source: (172888)  
[81:81:0610/043216.184054:INFO:CONSOLE(172888)] “Event ‘signal:chat’ triggered by ‘Session’ [object Object]”, source: (172888)

[81:81:0610/043222.327787:INFO:CONSOLE(172876)] “Received request: {“method”:“sendMessage”,“params”:{“data”:”{“message”:“信号”,“nickname”:“teacher”}",“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}}", source: (172876)  
[81:81:0610/043222.327848:INFO:CONSOLE(172888)] “New signal: {“data”:”{“message”:“信号”,“nickname”:“teacher”}",“type”:“signal:chat”,“from”:“con\_BC95tzqfTt”}", source: (172888)

Is there any solution ?

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 10, 2021, 3:46pm UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/5 "2021-06-10T15:46:58Z")

</div>

Ok, we have a theory. Maybe the thing is that the recording module does not have installed the needed fonts. It doesn’t matter that UTF-8 encoding is used if the underlying OS does not have the required fonts.  
We have released a patched version of the recording module with the fonts properly installed.  
We have also added a new flag to avoid getting that annoying “translate” pop up at the upper right corner.

To test it just add the following configuration property to your openvidu-server **.env** file:

```bash
OPENVIDU_RECORDING_VERSION=2.18.0-all-fonts

```

Please, test it and let us know if both things are fixed (the lack of korean characters in the recording file and the translate pop up).

Best regards.

---

<div class="post-metadata">

**Author:** ![es-hur](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@es-hur](https://openvidu.discourse.group/u/es-hur)\
**Post date:** [June 11, 2021, 2:38am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/6 "2021-06-11T02:38:43Z")

</div>

I tested it. there is no problem with the record file.

Issue has got solved thank you for help.

Best regards,  
pablo Fuente

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 11, 2021, 8:21am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/7 "2021-06-11T08:21:17Z")

</div>

We are still adjusting the fix. The size of the recording module was too big on the first approach (from 370MB went to 800MB just by installing new fonts. Which is unsustainable).  
We have been fine-tuning the installed fonts to reach a compromise. The new recording module has grown up to 417MB with the new selected fonts.

Please, if you can repeat the test to confirm that it still works, that would be much appreciated.

To download the new module just run this command on your nodes before starting OpenVidu:

```bash
docker pull openvidu/openvidu-recording:2.18.0-all-fonts

```

Best regards.

---

<div class="post-metadata">

**Author:** ![es-hur](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@es-hur](https://openvidu.discourse.group/u/es-hur)\
**Post date:** [June 16, 2021, 6:13am UTC](https://openvidu.discourse.group/t/character-encoding-problem-to-use-send-a-signal-api/3116/8 "2021-06-16T06:13:37Z")

</div>

I tested new openvidu-recording version.  
there is no problem with the record file.

docker images -a  
REPOSITORY TAG IMAGE ID CREATED SIZE  
openvidu/openvidu-recording 2.18.0-all-fonts dd568c766abf 5 days ago 1.08GB

Best regards.
