ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

does ROS_INFO support utf8 string?

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

rubick gravatar image

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

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 image rubick  ( 2014-11-24 23:55:49 -0500 )edit

Buddy. Have you sovled this problem?

Vance.fzu gravatar image Vance.fzu  ( 2017-07-31 22:52:32 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

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

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

Question Tools

1 follower

Stats

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

Seen: 726 times

Last updated: Jan 21 '20