utf-8

“Server sent charset (255) unknown to the client” Set MySQL charset to utf8 w/o /etc/my.cnf?

天涯浪子 提交于 2020-01-21 07:22:30
问题 I'm trying to connect to a MySQL database from phpMyAdmin. But when I put in username and password I get two error messages saying: mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers I'm using MySQL 8.0.11 and phpMyAdmin 4.8.2 I found this answer for a similar problem: PDO::__construct(): Server sent charset (255) unknown to the

Error: Incompatible character encodings: UTF-8 and ASCII-8BIT

拟墨画扇 提交于 2020-01-21 04:47:11
问题 I got the error incompatible character encodings: UTF-8 and ASCII-8BIT , when the view found in the database some characters like: ñ, á, é, etc. My enviroment is: Rails: 3.2.5 Ruby: 1.9.4p194 Database: Oracle 10g (10.2.0.1.0) I can save this characters in the database, using Toad. I tried to write this, in the first line of my view: <% # encoding: utf-8 %> In enviroment.erb Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 But nothing fixed this. Please,

How to convert UTF8 combined Characters into single UTF8 characters in ruby?

与世无争的帅哥 提交于 2020-01-21 02:47:30
问题 Some characters such as the Unicode Character 'LATIN SMALL LETTER C WITH CARON' can be encoded as 0xC4 0x8D , but can also be represented with the two code points for 'LATIN SMALL LETTER C' and 'COMBINING CARON', which is 0x63 0xcc 0x8c . More info here: http://www.fileformat.info/info/unicode/char/10d/index.htm I wonder if there is a library which can convert a 'LATIN SMALL LETTER C' + 'COMBINING CARON' into 'LATIN SMALL LETTER C WITH CARON'. Or is there a table containing these conversions?

sequel never returns utf-8, just ascii-8bit

末鹿安然 提交于 2020-01-21 01:34:06
问题 There is this mysql database I'm trying to connect to. DataMapper fetches everything nicely in UTF-8 but Sequel always returns strings in ASCII-8bit which produces errors with .to_json. I have tried several things in order to get it to work. Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 DB.run 'set names utf8' Sequel.mysql 'db', (...), :encoding => 'utf-8' I have gems: mysql (2.9.0) (tried without), mysql2 (0.3.11) and sequel (3.42.0) The only thing

How to convert hex value to Special Char( in Unicode )?

走远了吗. 提交于 2020-01-20 09:37:30
问题 In my previous question, I asked about conversion of Special Chars to Hex. Hex value of "ㅂ" is "e38582" Now I've got hex value in String. String hex = "e38582"; How to convert this hex value to get the special char.( In this example it's "ㅂ" ) I've tried this, but getting IllegalFormatConversionException : String hex = "e38582"; BigInteger value = new BigInteger(hex, 16); String str = String.format("%c", value ); System.out.println("String : "+ str); 回答1: Convert the hex to byte array.

Display Hindi language in console using Java

 ̄綄美尐妖づ 提交于 2020-01-20 08:09:11
问题 StringBuffer contents=new StringBuffer(); BufferedReader input = new BufferedReader(new FileReader("/home/xyz/abc.txt")); String line = null; //not declared within while loop while (( line = input.readLine()) != null){ contents.append(line); } System.out.println(contents.toString()); File abc.txt contains \u0905\u092d\u0940 \u0938\u092e\u092f \u0939\u0948 \u091c\u0928\u0924\u093e \u091c\u094b \u091a\u093e\u0939\u0924\u0940 \u0939\u0948 \u092 I want to dispaly in Hindi language in console

Display Hindi language in console using Java

孤街浪徒 提交于 2020-01-20 08:06:45
问题 StringBuffer contents=new StringBuffer(); BufferedReader input = new BufferedReader(new FileReader("/home/xyz/abc.txt")); String line = null; //not declared within while loop while (( line = input.readLine()) != null){ contents.append(line); } System.out.println(contents.toString()); File abc.txt contains \u0905\u092d\u0940 \u0938\u092e\u092f \u0939\u0948 \u091c\u0928\u0924\u093e \u091c\u094b \u091a\u093e\u0939\u0924\u0940 \u0939\u0948 \u092 I want to dispaly in Hindi language in console

Display Hindi language in console using Java

匆匆过客 提交于 2020-01-20 08:06:04
问题 StringBuffer contents=new StringBuffer(); BufferedReader input = new BufferedReader(new FileReader("/home/xyz/abc.txt")); String line = null; //not declared within while loop while (( line = input.readLine()) != null){ contents.append(line); } System.out.println(contents.toString()); File abc.txt contains \u0905\u092d\u0940 \u0938\u092e\u092f \u0939\u0948 \u091c\u0928\u0924\u093e \u091c\u094b \u091a\u093e\u0939\u0924\u0940 \u0939\u0948 \u092 I want to dispaly in Hindi language in console

How to display a non-ascii filename in the file download box in browsers?

£可爱£侵袭症+ 提交于 2020-01-20 05:53:25
问题 There doesn't seem to be an accepted way of sending down a header parameter in non ascii format. The header for file download usually looks like Content-disposition: attachment; filename="theasciifilename.doc" Except if you smash a utf8 encoded string in the filename parameter, Firefox will handle it fine, whereas IE will throw up. There is a document on CodeProject that explains a method for encoding the filename. This document encodes Bản Kiểm Kê.doc to B%e1%ba%a3n%20Ki%e1%bb%83m%20K%c3%aa

Internationalization using resource bundle properties in JSP, non-Latin text becomes Mojibake

喜夏-厌秋 提交于 2020-01-20 04:12:26
问题 I have the following index.jsp: <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <fmt:setLocale value="ru_RU"/> <fmt:setBundle basename="messages"/> <html> <head> <title></title> </head> <body> <h1><fmt:message key="login"/></h1> </body> </html> And property file messages_ru_RU.properties: login = Логин The problem is that I get the junk unicode characters in the output: Ëîãèí Update Changed the .properies file