character-encoding

Avoiding SSIS script task to convert utf-8 to unicode for AS400 data to SQL Server

大兔子大兔子 提交于 2020-01-04 14:31:12
问题 After many tries I have concluded that the optimal way to transfer with SSIS data from AS400 (non-unicode) to SQL Server is: Use native transfer utility to dump data to tsv (tab delimited) Convert files from utf-8 to unicode Use bulk insert to put them into SQL Server In #2 step I have found a ready made code that does this: string from = @"\\appsrv02\c$\bg_f0101.tsv"; string to = @"\\appsrv02\c$\bg_f0101.txt"; using (StreamReader reader = new StreamReader(from, Encoding.UTF8, false, 1000000)

Wrong Charset Encoding with Play Framework 2.1

拟墨画扇 提交于 2020-01-04 14:22:12
问题 I have a web service that receives a parameter in ISO-8859-1 encoding. But when I try to read it from the request, I get this characters: ����� I've tryied all these approaches, but none of the convert the given string to the expected one (áéíóú): val a = new String(_html.getBytes()); val b = new String(_html.getBytes(), "UTF-8") val c = new String(_html.getBytes(), "ISO-8859-1") val d = new String(_html.getBytes("ISO-8859-1"), "UTF-8") val e = new String(_html.getBytes("ISO-8859-1"), "ISO

Special characters in OSX filename ? (Python os.rename)

荒凉一梦 提交于 2020-01-04 14:10:15
问题 I am trying to rename some files automatically on OSX with a python script. But I fail to work with special characters like forward slash etc.: oldname = "/test" newname = "/test(1\/10)" os.rename(oldname, newname) I think I do have an encoding problem. But different tries with re.escape or using UTF-8 unicode encodings havent been successful for me. Would you have a hint? Thanks! Marco 回答1: What most of the file systems have in common is that they do not allow directory separators (slashes)

Prawn: Print unicode string in PDF

余生长醉 提交于 2020-01-04 13:34:10
问题 I'm using Prawn to generate PDFs in a Rails 3 app. Is it possible to print a Unicode string into a PDF like in a HTML view? For example, <%= raw "unicode_for_ཀ" %> in show.html.erb results in the glyph ཀ while pdf.text raw "unicode_for_ཀ" in show.pdf.prawn results in the string "unicode_for_ཀ" Tried in show.pdf.prawn : pdf.font "#{Prawn::BASEDIR}/data/fonts/TibMachUni-1.901b.ttf" do pdf.text raw "unicode_for_ཀ" end and pdf.font_families.update("TibMachUni" => {:normal => "#{Prawn::BASEDIR}

charsets in MySQL replication

让人想犯罪 __ 提交于 2020-01-04 12:22:11
问题 What can I do to ensure that replication will use latin1 instead of utf-8? I'm migrating between an MySQL 5.1.22 server (master) on a Linux system and a MySQL 5.1.42 server (slave) on a FreeBSD system. My replication works well, but when non-ascii characters are in my varchars, they turn "weird". The Linux/MySQL-5.1.22 shows the following character set variables: character_set_client=latin1 character_set_connection=latin1 character_set_database=latin1 character_set_filesystem=binary character

MySQL convert charset issue

↘锁芯ラ 提交于 2020-01-04 10:58:11
问题 I have an application which runs on PHP 5 and accesses and stores a MySQL database using the mysqli extension. The database contains numerous tables with the encoding UTF-8 (collation utf8_swedish_ci ). Unfortunately, it seems that the mysqli connection was configured to encode everything using ISO-8859-1,which means that I've got UTF-8 tables containing latin1 data. I am trying to repair this now, by shifting over everything to UTF-8 (as it should be!) Is there a built-in way of handling

MYSQL special chars issue

家住魔仙堡 提交于 2020-01-04 09:36:10
问题 I´ve been having this problem for a long time, I´ve searched the internet many times for the solution, tried lots of them but not found an adequate solution. I really don´t know what to do so if you could please help me I´d be very thankful. (Sorry for my poor english). Question: How can I solve the charset incompatibility between the input archive and a MYSql table? Problem: When importing the archive from on my computer the information appears in my database, but some chars as ('ã', 'ç', 'á

Writing a proxy in grails

你。 提交于 2020-01-04 09:15:32
问题 I am using Gralis 1.3.7. I am writing a controller that needs to get a PDF file from another server and return it to the client. I would like to do this in some reasonably efficient manner, such as the following: class DocController { def view = { URL source = new URL("http://server.com?docid=${params.docid}"); response.contentType = 'application/pdf'; // Something like this to set the content length response.setHeader("Content-Length", source.contentLength.toString()); response << source

Inserting Hebrew text into MySQL using PHP (garbage text)

元气小坏坏 提交于 2020-01-04 09:06:45
问题 I'm facing a weird problem with inserting hebrew text into mysql. Basically the problem is : I have a php script which picks up hebrew text from a csv file then send it to mysql database. The charset of both database and all fields of tables are set to UTF8 and collation to utf8_bin. But when I insert it using mysql, random garbage value appears inside the text which renders it completely useless for output. NOTE : I can still see half of the words appear correctly. Here is my homework which

Inserting Hebrew text into MySQL using PHP (garbage text)

拜拜、爱过 提交于 2020-01-04 09:06:42
问题 I'm facing a weird problem with inserting hebrew text into mysql. Basically the problem is : I have a php script which picks up hebrew text from a csv file then send it to mysql database. The charset of both database and all fields of tables are set to UTF8 and collation to utf8_bin. But when I insert it using mysql, random garbage value appears inside the text which renders it completely useless for output. NOTE : I can still see half of the words appear correctly. Here is my homework which