Все вопросы: [utf-8]

444 вопросов

2
голосов
2ответов
7001 просмотров

Ruby: How to convert a string to binary and write it to file

The data is a UTF-8 string: data = 'BZh91AY&SY\x94$|\x0e\x00\x00\x00\x81\x00\x03$ \x00!\x9ah3M\x13<]\xc9\x14\xe1BBP\x91\xf08' I have tried File.open("data.bz2", "wb").write(data.unpack('a*')) with all kinds of variations for unpack put have had no success. I just get the string in the f...

0
голосов
2ответов
306 просмотров

Converting a database from one character encoding to another

I have a MYSQL database. Text is currently stored in charset latin1, collation latin1_swedish_ci. These are the defaults and it wasn't a problem back in the day when the database was originally created. I want to switch over to UTF8 so the text encoding in the database matches out text encoding ...

1
голосов
2ответов
1815 просмотров

Delphi 7 Personal, MySQL using libmysql.dll + UTF8

I'm using Delphi 7 Personal. To access MySQL database I'm using libmysql.dll + very simple wrapper, which is good enough for me. Except one thing ... it doesn't seem to handle Utf8... is that possible somehow to pass Utf8 strings from libmysql to Delphi? Please keep in mind I'm not using commerci...

6
голосов
2ответов
5000 просмотров

Change Website Character encoding from iso-8859-1 to UTF-8

About 2 years ago I made the mistake of starting a large website using iso-8859-1. I now am having issues with some characters, especially when sending data to the server using ajax. Because of this, I would like to switch to using UTF-8. What issues do you see coming from this? I know I wo...

0
голосов
1ответов
1796 просмотров

struts2 request encoding

I am sending a XML in HTTP POST body. Question: Does struts2 support processing request in utf-8 encoding? Reference: http://www.experts-exchange.com/Programming/Languages/Java/Q_24061148.html (Around bottom of the page)

4
голосов
4ответов
4971 просмотров

C# and utf8_decode

Is there a C# utf8_decode equivalent?

2
голосов
4ответов
2944 просмотров

PHP Japanese Strings getting set to?

I have a PHP file with one simple echo function: echo 'アクセスは撥ねりません。'; but when I access that page i get this: ???????????? Can someone help me? I also have my page encoding set to UTF-8, and I know it, because all of the browsers i used said so. I also do this before the echo function: mb_...

0
голосов
1ответов
341 просмотров

Mysql's LIKE is missbehaving with Hebrew and backslashes, why?

I have the following SQL query which returns the correct results: SELECT * FROM `tags` WHERE tag_name = 'בית\\"ר-ירושלים' If I change it to SELECT * FROM `tags` WHERE tag_name LIKE 'בית\\"ר-ירושלים' or to SELECT * FROM `tags` WHERE tag_name LIKE 'בית\\"ר-ירושלים%' It doesn't work. It wil...

1
голосов
4ответов
15322 просмотров

utf-8 to iso-8859-1 encoding problem

I'm trying preview the latest post from an rss feed on another website. The feed is UTF-8 encoded, whilst the website is ISO-8859-1 encoded. When displaying the title, I'm using; $post_title = 'Blogging – does it pay the bills?'; echo mb_convert_encoding($post_title, 'iso-8859-1','utf-8'); ...

30
голосов
3ответов
36437 просмотров

Is "SET CHARACTER SET utf8" necessary?

I´m rewritting our database class (PDO based), and got stuck at this. I´ve been taught to both use SET NAMES utf8 and SET CHARACTER SET utf8 when working with UTF-8 in PHP and MySQL. In PDO I now want to use the PDO::MYSQL_ATTR_INIT_COMMAND parameter, but it only supports one query. Is SET CHAR...

33
голосов
10ответов
72668 просмотров

Character with encoding UTF8 has no equivalent in WIN1252

I am getting the following exception: Caused by: org.postgresql.util.PSQLException: ERROR: character 0xefbfbd of encoding "UTF8" has no equivalent in "WIN1252" Is there a way to eradicate such characters, either via SQL or programmatically? (SQL solution should be preferred). I was thinking ...

99
голосов
6ответов
148691 просмотров

Using StringWriter for XML Serialization

I'm currently searching for an easy way to serialize objects (in C# 3). I googled some examples and came up with something like: MemoryStream memoryStream = new MemoryStream ( ); XmlSerializer xs = new XmlSerializer ( typeof ( MyObject) ); XmlTextWriter xmlTextWriter = new XmlTextWriter ( memor...

3
голосов
1ответов
4659 просмотров

Why does ContentResult controller in ASP.NET MVC return UTF-16 when UTF-8 specified?

I have an ActionResult that returns XML for an embedded device. The relevant code is: return Content(someString, "text/xml", Encoding.UTF8); Even though UTF-8 is specified, the resulting XML is: <?xml version="1.0" encoding="utf-16"?> The ASP.NET MVC is compiled as AnyCPU and runs on...

0
голосов
3ответов
640 просмотров

Retrieving and displaying UTF-8 from a .CSV in Python

Basically I have been having real fun with this today. I have this data file called test.csv which is encoded as UTF-8: "Nguyễn", 0.500 "Trần", 0.250 "Lê", 0.250 Now I am attempting to read it with this code and it displays all funny like this: Trần Now I have gone through all the Python doc...

2
голосов
2ответов
7256 просмотров

Convert from hex string to unicode

How can i convert the 'dead' string to an unicode string u'\xde\xad'? Doing this: from binascii import unhexlify out = ''.join(x for x in [unhexlify('de'), unhexlify('ad')]) creates a <type 'str'> string '\xde\xad' Trying to use the Unicode.join() like this: from binascii import unhex...

0
голосов
2ответов
4039 просмотров

iText encoding problem

I have encoding problem with iText (http://www.lowagie.com/iText/). I load data from database and insert it as html to pdf with iText, for some reason my non-english (Finnish ä,ö etc) characters don't show up correctly. Following example shows how insert text to html: text = "<p>" + da...

2
голосов
1ответов
1788 просмотров

Unicode in NetBeans 6.7.1

When I type any text on Georgian language. NetBeans shows it like question marks. I'm using Windows7(georgian keyboard). I've also tried in Eclipse, but there is no such problem (everything works fine). Then I've tried to open my Eclipse project folder in NetBeans with some html files and the q...

1
голосов
2ответов
238 просмотров

How To Store Hmong Characters In MySQL Database

I've read a number of articles on storing multi-language strings in MySQL, but I can't seem to find anything specific (or credible) on Hmong. I have no trouble with latin (European) languages, but if someone could enlighten me on Hmong, that would be terrific. Thanks! P.S. Using PHP for the s...

110
голосов
3ответов
22911 просмотров

How does UTF-8 "variable-width encoding" work?

The unicode standard has enough code-points in it that you need 4 bytes to store them all. That's what the UTF-32 encoding does. Yet the UTF-8 encoding somehow squeezes these into much smaller spaces by using something called "variable-width encoding". In fact, it manages to represent the fi...

2
голосов
1ответов
170 просмотров

What's the appropriate Unicode character to flag users on the website?

I run a quiz-like website at slagalica.tv (content is not in English). We often have users that try to cheat the system, so we flag those accounts and they get special treatment. Now I'd like to add some character beside their name to be visible everywhere across the website, so that everyone kno...

2
голосов
1ответов
346 просмотров

Please help me trace how charsets are handled every step of the way

We all know how easy character sets are on the web, yet every time you think you got it right, a foreign charset bites you in the butt. So I'd like to trace the steps of what happens in a fictional scenario I will describe below. I'm going to try and put down my understanding as well as possible ...

2
голосов
2ответов
4505 просмотров

Getting UTF-8 data from MySQL to the Linux C++ application

I have a big troubles with display of UTF-8 data retrieved from the MySQL to the Linux-based C++ application. UTF text is shown as question marks. The application uses the MySQL C API. So I passed the UTF-8 option after mysql_init() and before mysql_real_connect(): mysql_options(&mysql, MY...

0
голосов
1ответов
254 просмотров

Fixing Unicode Oops

It seems that we have managed to insert into our database 2 unicode characters for each of the unicode characters we want, For example, for the unicde char 0x3CBC, we've inserted the unicode equivalents for each of it's components (0xC383 AND 0xC2BC) Can anyone think of a simple solution for fi...

0
голосов
1ответов
597 просмотров

saving to mysql database using php and mysqli

i'm trying to save data to database and i get an error i never saw before i have a hunch it has something to do with the db collation but I'm not sure whats wrong, here is the query: $query1 = "INSERT INTO scape.url (url,normalizedurl,service,idinservice) VALUES (url, normalizedurl, 4, 45454)";...

0
голосов
1ответов
4362 просмотров

How to convert XML file in UTF-8 using Groovy builder StreamingMarkupBuilder

Even if the question subject seems complicated, the issue is quite simple. I create an XML file with the following script: def xmlFile = new File("file-${System.currentTimeMillis()}.xml") mb = new groovy.xml.StreamingMarkupBuilder() mb.encoding = "UTF-8" new FileWriter(xmlFile) << mb.bind...

3
голосов
5ответов
3562 просмотров

How to deal with query parameter's encoding?

I assumed that any data being sent to my parameter strings would be utf-8, since that is what my whole site uses throughout. Lo-and-behold I was wrong. For this example has the character ä in utf-8 in the document (from the query string) but proceeds to send a B\xe4ule (which is either ISO-8859-...

33
голосов
9ответов
38351 просмотров

How do I use filesystem functions in PHP, using UTF-8 strings?

I can't use mkdir to create folders with UTF-8 characters: <?php $dir_name = "Depósito"; mkdir($dir_name); ?> when I browse this folder in Windows Explorer, the folder name looks like this: Depósito What should I do? I'm using php5

20
голосов
5ответов
21314 просмотров

Ensuring valid UTF-8 in PHP

I'm using PHP to handle text from a variety of sources. I don't anticipate it will be anything other than UTF-8, ISO 8859-1, or perhaps Windows-1252. If it's anything other than one of those, I just need to make sure the text gets turned into a valid UTF-8 string, even if characters are lost. Doe...

3
голосов
2ответов
3313 просмотров

Croatian diacritic signs in MySQL db (utf-8)

Diacritic signs http://img98.imageshack.us/img98/3383/dijakritickiznakovi.gif So, symbols belows display title should be displayed that way. UTF-8 entities are listed below HTML (utf-8) title (here is list: LINK) And last line shows what is stored in my database. Collation of db table is utf8_un...

6
голосов
4ответов
1813 просмотров

Can seek and tell work with UTF-8 encoded documents in Python?

I have an application that generates some large log files> 500MB. I have written some utilities in Python that allows me to quickly browse the log file and find data of interest. But I now get some datasets where the file is too big to load it all into memory. I thus want to scan the documen...