Browse Source

Fixed UTF8 encodings, force mysql use utf8. Set utf meta at html base.

David Moreno 12 years ago
parent
commit
652eb1a7f7
2 changed files with 2 additions and 0 deletions
  1. 1 0
      onion/base.html
  2. 1 0
      onion/hello.c

+ 1 - 0
onion/base.html

@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
 <html>
   <head>
   <head>
+    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
     <title>{{title}}</title>
     <title>{{title}}</title>
   </head>
   </head>
   <body>
   <body>

+ 1 - 0
onion/hello.c

@@ -268,6 +268,7 @@ int main(void){
 	int i;
 	int i;
 	for (i=0;i<NCONN;i++){
 	for (i=0;i<NCONN;i++){
 		data.db[i]=mysql_init(NULL);
 		data.db[i]=mysql_init(NULL);
+		mysql_options(data.db[i], MYSQL_SET_CHARSET_NAME, "utf8");
 		data.free_db[i]=1;
 		data.free_db[i]=1;
 		if (data.db[i]==NULL){
 		if (data.db[i]==NULL){
 			ONION_ERROR("Cant create db connection: %s", mysql_error(data.db[i]));
 			ONION_ERROR("Cant create db connection: %s", mysql_error(data.db[i]));