Ask Your Question
1

does ROS_INFO support utf8 string?

asked 2014-11-13 01:48:42 -0600

rubick gravatar image

updated 2014-11-13 02:02:37 -0600

I'm Chinese. So I want to print some Chinese info, like:

ROS_INFO ("调试信息");

but all I got is:

[ INFO] [1415863087.967254365]: ????????????

(by the way, printf goes well)

I save the cpp source file in utf8 format.

so, does ROS_INFO support utf8 string ?

thanks!

edit retag flag offensive close merge delete

Comments

any body know about it ?

rubick gravatar imagerubick ( 2014-11-24 23:55:49 -0600 )edit

Buddy. Have you sovled this problem?

Vance.fzu gravatar imageVance.fzu ( 2017-07-31 22:52:32 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-01-21 06:43:50 -0600

Diogo42 gravatar image

I found this link and helped me : Link in portuguese.

This command takes the encoding of the machine running the program.

Add include locale in your code:

#include <locale.h>
#include "ros/ros.h"

 int main(int argc, char **argv) {
     setlocale( LC_ALL, "" ); 
     ROS_INFO ("调试信息");
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-11-13 01:47:44 -0600

Seen: 362 times

Last updated: Jan 21