utf-8

Rails + Ruby 1.9 “invalid byte squence in US-ASCII”

泪湿孤枕 提交于 2020-01-13 19:11:42
问题 After upgrading to ruby 1.9 we began to notice pages failing to render from the rails template renderer when a user used a non-ASCII character. Specifically "é". I was able to resolve this issue on one of our staging servers, but I have not been able to reproduce the fix on our production server. The fix that seemed to work the first time: Converted the database from latin1 to utf8 using the convert_charset tool available here: http://www.mysqlperformanceblog.com/2009/03/17/converting

Rails + Ruby 1.9 “invalid byte squence in US-ASCII”

淺唱寂寞╮ 提交于 2020-01-13 19:10:31
问题 After upgrading to ruby 1.9 we began to notice pages failing to render from the rails template renderer when a user used a non-ASCII character. Specifically "é". I was able to resolve this issue on one of our staging servers, but I have not been able to reproduce the fix on our production server. The fix that seemed to work the first time: Converted the database from latin1 to utf8 using the convert_charset tool available here: http://www.mysqlperformanceblog.com/2009/03/17/converting

export and import utf8 data in mysql: best practices

最后都变了- 提交于 2020-01-13 13:09:03
问题 We're often faced with the need to send a data file to one of our clients with data from the database he/she needs to translate. Most of the time this export is CSV or XLS. Most of the time we create a csv dump with phpmyadmin and get an xls file in return with the translated data. The problem is that most of the time the data is UTF8 and when the file is returned as xls each and every time we load the data into mysql again we end up with utf8 problems, characters not being displayed properly

export and import utf8 data in mysql: best practices

喜夏-厌秋 提交于 2020-01-13 13:06:25
问题 We're often faced with the need to send a data file to one of our clients with data from the database he/she needs to translate. Most of the time this export is CSV or XLS. Most of the time we create a csv dump with phpmyadmin and get an xls file in return with the translated data. The problem is that most of the time the data is UTF8 and when the file is returned as xls each and every time we load the data into mysql again we end up with utf8 problems, characters not being displayed properly

Javascript -> Download CSV file encoded in ISO-8859-1 / Latin1 / Windows-1252

☆樱花仙子☆ 提交于 2020-01-13 12:08:15
问题 I have hacked together a small tool to extract shipping data from Amazon CSV order data. it works so far. here is a simple version as JS Bin: http://output.jsbin.com/jarako For printing stamps/shipping labels, I need a file for uploading to Deutsche Post and to other parcel services. I used a small function saveTextAsFile which i found on stackoverflow. Everything good so far. No wrong displayed special characters (äöüß...) in the output textarea or downloaded files. All these german post /

Javascript -> Download CSV file encoded in ISO-8859-1 / Latin1 / Windows-1252

这一生的挚爱 提交于 2020-01-13 12:08:14
问题 I have hacked together a small tool to extract shipping data from Amazon CSV order data. it works so far. here is a simple version as JS Bin: http://output.jsbin.com/jarako For printing stamps/shipping labels, I need a file for uploading to Deutsche Post and to other parcel services. I used a small function saveTextAsFile which i found on stackoverflow. Everything good so far. No wrong displayed special characters (äöüß...) in the output textarea or downloaded files. All these german post /

Is it possible to convert a string containing “high” unicode chars to an array consisting of dec values derived from utf-32 (“real”) codes?

左心房为你撑大大i 提交于 2020-01-13 12:07:05
问题 Please, look at this script operating on a (theoretically possible) string: <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script src="jquery.js"></script> <script> $(function () { $("#click").click(function () { var txt = $('#high-unicode').text(); var codes = ''; for (var i = 0; i < txt.length; i++) { if (i > 0) codes += ','; codes += txt.charCodeAt(i); } alert(codes); }); }); </script> </head> <body> <span id="click">click</span><br /> <span id="high-unicode">𝑥<!--

Is it possible to convert a string containing “high” unicode chars to an array consisting of dec values derived from utf-32 (“real”) codes?

隐身守侯 提交于 2020-01-13 12:04:30
问题 Please, look at this script operating on a (theoretically possible) string: <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script src="jquery.js"></script> <script> $(function () { $("#click").click(function () { var txt = $('#high-unicode').text(); var codes = ''; for (var i = 0; i < txt.length; i++) { if (i > 0) codes += ','; codes += txt.charCodeAt(i); } alert(codes); }); }); </script> </head> <body> <span id="click">click</span><br /> <span id="high-unicode">𝑥<!--

Is it possible to convert a string containing “high” unicode chars to an array consisting of dec values derived from utf-32 (“real”) codes?

北慕城南 提交于 2020-01-13 12:04:24
问题 Please, look at this script operating on a (theoretically possible) string: <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script src="jquery.js"></script> <script> $(function () { $("#click").click(function () { var txt = $('#high-unicode').text(); var codes = ''; for (var i = 0; i < txt.length; i++) { if (i > 0) codes += ','; codes += txt.charCodeAt(i); } alert(codes); }); }); </script> </head> <body> <span id="click">click</span><br /> <span id="high-unicode">𝑥<!--

Is it possible to convert a string containing “high” unicode chars to an array consisting of dec values derived from utf-32 (“real”) codes?

一曲冷凌霜 提交于 2020-01-13 12:04:05
问题 Please, look at this script operating on a (theoretically possible) string: <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script src="jquery.js"></script> <script> $(function () { $("#click").click(function () { var txt = $('#high-unicode').text(); var codes = ''; for (var i = 0; i < txt.length; i++) { if (i > 0) codes += ','; codes += txt.charCodeAt(i); } alert(codes); }); }); </script> </head> <body> <span id="click">click</span><br /> <span id="high-unicode">𝑥<!--