Avoid displaying non-ASCII characters

Avoid displaying UTF-8 characters on the terminal (French quotes &
ellipsis).
This commit is contained in:
Matteo Cypriani 2012-01-24 18:43:00 +01:00
parent dd01705608
commit 16eaecc53f
13 changed files with 50 additions and 50 deletions

View File

@ -278,12 +278,12 @@ int parse_config_file(int argc, char **argv)
{
case CFG_FILE_ERROR :
fprintf(stderr,
"Error! Cannot open configuration file « %s »: %s.\n",
"Error! Cannot open configuration file \"%s\": %s.\n",
config_file, strerror(errno)) ;
break ;
case CFG_PARSE_ERROR :
fprintf(stderr,
"Error! Parsing of configuration file « %s » failed!\n",
"Error! Parsing of configuration file \"%s\" failed!\n",
config_file) ;
free(config_file) ;
owl_run = owl_false ;
@ -537,7 +537,7 @@ int read_loop(int sockfd)
) ;
}
else if (VERBOSE_CHATTERBOX)
fprintf(stderr, "Request received from AP « %s ».\n",
fprintf(stderr, "Request received from AP \"%s\".\n",
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
got_request(request) ;
@ -770,7 +770,7 @@ void got_request(owl_captured_request request)
if (requests == NULL) // If the request list does not exist,
{
if (VERBOSE_INFO)
fprintf(stderr, "Creating request list with AP « %s ».\n",
fprintf(stderr, "Creating request list with AP \"%s\".\n",
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
tmp_request = malloc(sizeof(request_list)) ; // create it.
tmp_request->type = request.type ;
@ -830,7 +830,7 @@ void got_request(owl_captured_request request)
if (tmp_request == NULL) // The request does not exist in the list
{
if (VERBOSE_INFO)
fprintf(stderr, "Create new request from AP « %s ».\n",
fprintf(stderr, "Create new request from AP \"%s\".\n",
owl_mac_bytes_to_string(request.ap_mac_addr_bytes)) ;
tmp_request = malloc(sizeof(request_list)) ; // create it
tmp_request->type = request.type ;
@ -946,7 +946,7 @@ void* listen_for_aps(void *NULL_value)
if (VERBOSE_INFO)
fprintf(stderr,
"Got a Hello message from « %s »\n", ap_ip_addr) ;
"Got a Hello message from \"%s\"\n", ap_ip_addr) ;
sem_wait(&lock_aps) ;
update_ap(message.ap_mac_addr_bytes, ap_ip_addr) ;
@ -1015,7 +1015,7 @@ ap_list* add_ap_front(uint8_t mac_addr_bytes[ETHER_ADDR_LEN])
char mac_str[OWL_ETHER_ADDR_STRLEN] ;
owl_mac_bytes_to_string_r(mac_addr_bytes, mac_str) ;
fprintf(stderr,
"Creating AP with MAC address « %s »...\n", mac_str) ;
"Creating AP with MAC address \"%s\"...\n", mac_str) ;
}
ap_list *ap = malloc(sizeof(ap_list)) ;
@ -1135,7 +1135,7 @@ void delete_ap(ap_list *ap)
char mac_str[OWL_ETHER_ADDR_STRLEN] ;
assert(ap) ;
owl_mac_bytes_to_string_r(ap->mac_addr_bytes, mac_str) ;
fprintf(stderr, "Deleting AP « %s »...\n", mac_str) ;
fprintf(stderr, "Deleting AP \"%s\"...\n", mac_str) ;
}
unlink_ap(ap) ;

View File

@ -312,7 +312,7 @@ void check_configuration()
if (options.direction < OWL_DIRECTION_MIN ||
options.direction > OWL_DIRECTION_MAX)
{
fprintf(stderr, "Error! « %"PRIu8" » is not a valid"
fprintf(stderr, "Error! \"%"PRIu8"\" is not a valid"
" direction.\n", options.direction) ;
exit(OWL_ERR_BAD_USAGE) ;
}
@ -340,7 +340,7 @@ void check_configuration()
{
#ifdef DEBUG
fprintf(stderr, "Warning! You cannot wait for a server answer when"
" you calibrate. Option -l ignored\n") ;
" you calibrate. Option -l ignored...\n") ;
#endif // DEBUG
options.listening_port = 0 ;
}
@ -352,7 +352,7 @@ void check_configuration()
{
#ifdef DEBUG
fprintf(stderr, "Warning! You cannot wait for a server answer"
" when you flood. Option -l ignored\n") ;
" when you flood. Option -l ignored...\n") ;
#endif // DEBUG
options.listening_port = 0 ;
}
@ -363,7 +363,7 @@ void check_configuration()
#ifdef DEBUG
fprintf(stderr, "Warning! It is useless to detach from"
" the foreground if the flood mode is not activated"
" Option -D ignored\n") ;
" Option -D ignored...\n") ;
#endif // DEBUG
options.daemon = owl_false ;
}
@ -443,7 +443,7 @@ void make_packet()
if (is_calibration_request) // Calibration packet
{
printf("Preparing calibration request packet\n") ;
printf("Preparing calibration request packet...\n") ;
offset = 0 ;
packet_size =
@ -478,7 +478,7 @@ void make_packet()
else // Standard packet
{
printf("Preparing request packet\n") ;
printf("Preparing request packet...\n") ;
packet_size = sizeof(uint8_t) + sizeof(owl_timestamp) ;
packet = malloc(packet_size) ;
memset(&packet[0], OWL_REQUEST_NORMAL, 1) ; // Packet type

View File

@ -404,12 +404,12 @@ int parse_config_file(int argc, char **argv)
{
case CFG_FILE_ERROR :
fprintf(stderr,
"Error! Cannot open configuration file « %s »: %s.\n",
"Error! Cannot open configuration file \"%s\": %s.\n",
config_file, strerror(errno)) ;
break ;
case CFG_PARSE_ERROR :
fprintf(stderr,
"Error! Parsing of configuration file « %s » failed!\n",
"Error! Parsing of configuration file \"%s\" failed!\n",
config_file) ;
free(config_file) ;
owl_run = owl_false ;
@ -580,7 +580,7 @@ int check_configuration()
case MODE_PASSIVE :
break ;
default :
fprintf(stderr, "Error! Unknown mode « %c ».\n", (char) GET_MODE()) ;
fprintf(stderr, "Error! Unknown mode \"%c\".\n", (char) GET_MODE()) ;
print_usage() ;
owl_run = owl_false ;
return OWL_ERR_BAD_USAGE ;
@ -640,7 +640,7 @@ int check_configuration()
if (coordinates_provided)
if (GET_MY_DIRECTION() < OWL_DIRECTION_MIN ||
GET_MY_DIRECTION() > OWL_DIRECTION_MAX)
fprintf(stderr, "Warning! « %d » is not a valid"
fprintf(stderr, "Warning! \"%d\" is not a valid"
" direction.\n", (int) GET_MY_DIRECTION()) ;
// Autocalibration port numbers

View File

@ -120,9 +120,9 @@ bool CSVFileReader::read_point3d(Point3D &p)
void CSVFileReader::print_error_cast() const
{
cerr
<< "Bad value « "
<< *token_iterator << " » at line "
<< "Bad value \""
<< *token_iterator << "\" at line "
<< current_line_nb << ", field #"
<< current_field_nb << ", of input file « "
<< file_name << " »!" << endl ;
<< current_field_nb << ", of input file \""
<< file_name << "\"!" << endl ;
}

View File

@ -69,7 +69,7 @@ void Input::initialise_input_medium()
else
throw bad_configuration(
"The specified input medium « "+ medium_name +" » is unknown!") ;
"The specified input medium \""+ medium_name +"\" is unknown!") ;
}
@ -92,8 +92,8 @@ void Input::initialise_log_media()
else
throw bad_configuration(
"The input medium « "+ *i +
" » specified for request logging is unknown!") ;
"The input medium \""+ *i +
"\" specified for request logging is unknown!") ;
}
}

View File

@ -65,7 +65,7 @@ void InputDataReader::initialise_access_points_media()
else
throw bad_configuration(
"Access points input medium type unknown « "+ *i +" »") ;
"Access points input medium type unknown \""+ *i +"\"") ;
}
}
@ -110,7 +110,7 @@ void InputDataReader::initialise_mobiles_media()
else
throw bad_configuration(
"Mobiles' input medium type unknown « "+ *i +" »") ;
"Mobiles' input medium type unknown \""+ *i +"\"") ;
}
}
@ -159,7 +159,7 @@ void InputDataReader::initialise_topology_media()
else
throw bad_configuration(
"Topology input medium type unknown « "+ *i +" »") ;
"Topology input medium type unknown \""+ *i +"\"") ;
}
}
@ -214,7 +214,7 @@ void InputDataReader::initialise_reference_points_media()
else
throw bad_configuration(
"Reference points input medium type unknown « "+ *i +" »") ;
"Reference points input medium type unknown \""+ *i +"\"") ;
}
}

View File

@ -63,7 +63,7 @@ void Output::initialise_output_media()
else
throw bad_configuration(
"The specified output medium « "+ *i +" » is unknown!") ;
"The specified output medium \""+ *i +"\" is unknown!") ;
}
}

View File

@ -109,8 +109,8 @@ area_of_interest_number(const Point3D &position) const
catch (boost::bad_lexical_cast &e)
{
cerr
<< "Cannot convert the area of interest's name (« "
<< area->get_name() << " ») into an integer value: "
<< "Cannot convert the area of interest's name (\""
<< area->get_name() << "\") into an integer value: "
<< e.what() << '\n' ;
}
@ -153,7 +153,7 @@ bool OutputTCPSocketEvAAL::acknowledge() const
}
cerr
<< "TCP server error: unknown acknoledgment string « "
<< ack << " ».\n" ;
<< "TCP server error: unknown acknoledgment string \""
<< ack << "\".\n" ;
return false ;
}

View File

@ -70,9 +70,9 @@ null_input_medium::null_input_medium() throw():
error_opening_input_file::
error_opening_input_file(const string &file_name) throw():
posexcept("Error opening input file « " + file_name + " »!") {}
posexcept("Error opening input file \"" + file_name + "\"!") {}
error_opening_output_file::
error_opening_output_file(const string &file_name) throw():
posexcept("Error opening output file « " + file_name + " »!") {}
posexcept("Error opening output file \"" + file_name + "\"!") {}

View File

@ -113,8 +113,8 @@ void Positioning::initialise_algorithms()
else
throw bad_configuration(
"The specified positioning_algorithm « "+ *i +
" » is unknown!") ;
"The specified positioning_algorithm \""+ *i +
"\" is unknown!") ;
}
}
@ -145,8 +145,8 @@ void Positioning::loop()
{
cerr
<< "Cannot compute with algorithm "
<< (*algo)->get_name() << ": « "
<< e.what() << " »\n" ;
<< (*algo)->get_name() << ": \""
<< e.what() << "\"\n" ;
continue ;
}

View File

@ -109,7 +109,7 @@ std::ostream& operator<<(ostream &os, const Result &r)
os
<< "The result of the algorithm " << r.algorithm
<< " is: " << r.position
<< " (area: « " << r.in_which_area() << " »)" ;
<< " (area: \"" << r.in_which_area() << "\")" ;
if (r.error >= 0)
os << ", error = " << r.error << " m" ;
return os ;

View File

@ -79,7 +79,7 @@ const Building& Stock::get_building(const string &name)
buildings.find(name) ;
if (i != buildings.end())
return i->second ;
throw element_not_found("No Building with name « " + name + " »!") ;
throw element_not_found("No Building with name \"" + name + "\"!") ;
}
@ -166,8 +166,8 @@ const Mobile& Stock::get_mobile(const string &mac)
unordered_map<string, Mobile>::const_iterator i = mobiles.find(mac) ;
if (i != mobiles.end())
return i->second ;
throw element_not_found("No Mobile with MAC address « " +
mac + " »!") ;
throw element_not_found("No Mobile with MAC address \"" +
mac + "\"!") ;
}
@ -230,8 +230,8 @@ const AccessPoint& Stock::get_ap(const string &mac)
unordered_map<string, AccessPoint>::const_iterator i = aps.find(mac) ;
if (i != aps.end())
return i->second ;
throw element_not_found("No AccessPoint with MAC address « " +
mac + " »!") ;
throw element_not_found("No AccessPoint with MAC address \"" +
mac + "\"!") ;
}
@ -249,8 +249,8 @@ const AccessPoint& Stock::find_create_ap(const string &mac)
if (Configuration::is_configured("verbose"))
cerr
<< "New AP « " << mac
<< " » (total: " << nb_aps() << " APs).\n" ;
<< "New AP \"" << mac
<< "\" (total: " << nb_aps() << " APs).\n" ;
return ap ;
}

View File

@ -374,9 +374,9 @@ void UserInterface::parse_file() const
if (! config_file)
{
cerr
<< "Warning! Error opening input configuration file « "
<< "Warning! Error opening input configuration file \""
<< config_file_name
<< " »! Using command line and default values…"
<< "\"! Using command line and default values..."
<< endl ;
return ;
}