Questions tagged [iconv]

iconv is a library and API for converting between different character encodings.

iconv can refer to one of three things:

  1. The iconv() API call standardised as part of the POSIX specification.
  2. The iconv command-line utility, also part of the POSIX specification.
  3. The libiconv library, a GNU project that implements the iconv() API and command-line utility.

In all cases, the API/utility/library is used to convert text between different formats.

631 questions
0
votes
1 answer

iconv : Converting from UTF-16LE to UTF-8 terminates in middle of the string

I have a UTF-16LE string 'TEST' and its hexdump as below feff 0074 0065 0073 0074 000a If I convert this string to UTF-8 using the command iconv on bash, then it is getting converted without any issues. 6574 7473 000a But, If I do the same this…
Sujay SA
  • 11
  • 3
0
votes
1 answer

iconv: cannot convert some strings from gb3212 to UTF-8

Good day! I have a problem with converting this string in gb3212: "е – с" My actions: [i.remen@win74 ~]$ iconv -f gb2312 -t utf-8 tst.txt е iconv: illegal input sequence at position 3 [i.remen@win74 ~]$ I tried many different versions(both from…
BHYCHIK
  • 21
  • 4
0
votes
1 answer

php's iconv() not displaying proper strings anymore

I have been using iconv to convert data from my company's database (windows-1250) to UTF8. It all worked fine until recently. I'm not really sure what happened, as I've noticed the change only recently. The problem is that iconv seems to stop…
maialithar
  • 3,065
  • 5
  • 27
  • 44
0
votes
1 answer

iconv() 32 bit vs 64 bit on Linux

I have a bit of code that uses iconv() on Linux to validate a string as being UTF-8 encoded. The conversion I create like: iconv_t c = iconv_open("UTF-8","UTF-8"); I run iconv() like: int status = iconv(c, &fromArray, (size_t*)&inSize, &toArray,…
DAG
  • 315
  • 3
  • 9
0
votes
2 answers

Highchart use other data for export

I have a question about highchart exporting. I need to use highchart own export and I wonder that I use another data series for exporting. For example; series: [{ type: 'pie', name: '', data: [], data:…
Yasin Yörük
  • 1,500
  • 7
  • 27
  • 51
0
votes
1 answer

remove diacritics with iconv in ruby on rails not working

i have some problem with removing diacritics with iconv in ruby on rails here is my code: class Diacritics def removeDiacritics(text) dRemover = Iconv.new("ASCII//TRANSLIT", "UTF-8") text = dRemover.iconv(text).gsub(/[^a-zA-Z0-9 ]/, '') …
0
votes
1 answer

Restore original encoding in Sublime Text 2

I opened a file and didn't noticed that it was in windows-1251 encoding. It was opened as utf-8 encoded file with incorrect characters. Then I pasted there a bunch of code in utf-8 encoding. After saving (with some error message about falling back…
Kasheftin
  • 7,509
  • 11
  • 41
  • 68
0
votes
0 answers

Symfony 2 and Goutte

I want to get some information from a site with CP1251 encoding. use Goutte\Client; use Nonlux\Bundle\Entity\News; .... protected function downloadQueuePage(){ $cli = new Client(); $url=array_pop($this->_url); …
nonlux
  • 774
  • 2
  • 6
  • 20
0
votes
1 answer

How can i change the character set of mysql database with php without changing the correct ones?

I'm currently using a MySQL database, and the previous guy that maintained the database has changed the character set from ISO-8859-1 to UTF-8. Now there is a problem that every ä turns into ä. Now I've wrote code to change all of the records in…
0
votes
2 answers

Euro symbol breaks mysql insertion process

I have written data crawling engine which does (so far) everything right except it completely stops data inserting process at the point where euro € symbol ocurres in the text. I belive this symbol may not be the only one. If string that is about to…
Miloš Đakonović
  • 3,751
  • 5
  • 35
  • 55
0
votes
0 answers

Problems after iconv with strlen and strtok

I have written a code to convert an input UCS-2LE file to normal 8 bit ISO-8859-1 text. After I convert it, I am splitting the entire text into words using strtok function. Now I am applying strlen on each of the word obtained, but I am getting…
Prasad
  • 5,946
  • 3
  • 30
  • 36
0
votes
2 answers

PHP creating slugify (clean URL) links in simple way? iconv malfunction?

I think this is the simplest way to slugify urls. You have any contra-indication? function url_clean($str) { $str = iconv('utf-8', 'us-ascii//TRANSLIT', $str); $clean_str = preg_replace(array( '/\'|\"/', '/ /' ) , array( …
eapo
  • 1,053
  • 1
  • 19
  • 40
0
votes
3 answers

Ruby EBCDIC conversion with String#encode instead of iconv

I used to do it fine with: Iconv.iconv('ASCII', 'EBCDIC-US', someEBCDICstring) since ruby 1.9 I get that warning: iconv will be deprecated in the future, use String#encode instead. but I can't find any reference of EBCDIC or cp37, cp500, cp875...…
Victor
  • 1,680
  • 3
  • 22
  • 40
0
votes
1 answer

linux libiconv transcode from ISO8859 or IBM850 to UTF8 error

I don't know what the original code is, so I assume that the original code is IBM850 or ISO8859-1.My process below IBM850 -> UTF8 if this is OK, I consider the original code is IBM850, if NOK,do next step: ISO8859-1 -> UTF8 if this is OK, I…
Skyline
  • 53
  • 4
0
votes
0 answers

latin1 to utf8 conversion issues

I am converting an old application that uses a mySQL database encoded with latin1. To do this I made a simple rake task and some classes to connect to the old legacy database (MySQL) class LegacyComment < ActiveRecord::Base establish_connection…
Kansha
  • 570
  • 4
  • 12