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
3 answers

iconv with ascii // transit triggers ErrorException: "iconv(): Detected an illegal character in input string"

First of all, I have to say that; I am a stranger of multilingual conversions. I have strings that i want to mb_lowercase in UTF-8 form if possible (sth like clean url), and I use $str = iconv("UTF-8", "ASCII//TRANSLIT", utf8_encode($str)); $str =…
Hilmi Erdem KEREN
  • 1,949
  • 20
  • 29
0
votes
2 answers

iconv encoding conversion problem

I am having trouble converting strings from utf8 to gb2312. My convert function is below void convert(const char *from_charset,const char *to_charset, char *inptr, char *outptr) { size_t inleft = strlen(inptr); size_t outleft = inleft; …
user187920
  • 161
  • 2
  • 2
  • 11
0
votes
0 answers

Node.js request with buffer in form

I am trying to send an xml string to a third party server. The string has to be ISO-8859-8 encoded. Here's what I try using request and iconv-lite: var request_xml = 'my xml string...'; var header = "
Michael
  • 22,196
  • 33
  • 132
  • 187
0
votes
1 answer

C++ convert UTF8 char array to CP1250

I have a problem converting UTF8 encoded char array to CP1250 encoded char array. I tried making a static iconv lib, but when compiling my UTF8->CP1250 code it always fail with 1>foo.obj : error LNK2001: unresolved external symbol…
bartimar
  • 3,374
  • 3
  • 30
  • 51
0
votes
1 answer

Convert utf-8 back to one-byte binary in PHP

I have a lot of images which has been imported from SQL dump with utf-8 encoding. Thus, instead of "FF D8 FF E0" I see "C3 BF C3 98 C3 BF C3 A0" in the beginning of jpeg images. I've tried iconv('utf-8', 'iso-8859-1', $data) but it not converts…
Epsiloncool
  • 1,435
  • 16
  • 39
0
votes
1 answer

Iconv byte length

I am using iconv to convert string from CP1251 to UTF-8 Problem is that string length before conversion is 4 bytes, after 8. After converting i send message to Apple servers, where is length is limited. How I can get conversion and keep the same…
nik1004
  • 327
  • 3
  • 11
0
votes
1 answer

How to convert UTF8 to cp1252 correctly (1.8.7)

I am not sure how to tell Iconv to transcode my strings to readable output. Example: I am converting a "LATIN CAPITAL LETTER S WITH CARON" U+0160, rendered as Š. Iconv.conv('cp1252', 'UTF8', 'Š') however returns "\212" I would expect it to return…
kostja
  • 60,521
  • 48
  • 179
  • 224
0
votes
3 answers

Need to convert 16 bit data to 8 bit

int main() { char str[200] = {0}; char out[500] = {0}; str[0]=0x00; str[1]=0x52; str[2]=0x00; str[3]=0x65; str[4]=0x00; str[5]=0x73; str[6]= 0x00; str[7]=0x74; for(int i=0;i
0
votes
0 answers

Completly random Encoding within the database itself but software reads it correctly. I would like to do that too

I'm using a very old software written probably in VB6 which is discontinued since years. This software is using SQL Server 2005 database. My goal was to use this database inside my PHP application. The problem is characters encoding. Database's…
Mike
  • 842
  • 1
  • 9
  • 31
0
votes
0 answers

Forcing text to be UTF compliant using php iconv

I am currently forcing data from a server to be UTF compliant by using the line of php: $name = iconv('UTF-8', 'UTF-8//TRANSLIT', $name); This works flawlessly on my server running php 5.3, but not 5.4. (not sure if version is relevant). The…
Lugubrious
  • 380
  • 1
  • 3
  • 16
0
votes
0 answers

how to read multibyte chars without knowing their code page on mac using c++

I'm trying to read some multibyte chars on mac, but the the their code page is unknown. Is there a way to read them and convert them to utf-8? the locale and region can be used, is there a way to connect them to the corresponding code page info? for…
xiaohei
  • 97
  • 1
  • 9
0
votes
3 answers

ISO-8859-1 Character truncates text inserting into utf-8 mysql column

So I have a weird truncate issue! Can't find a specific answer on this. So basically there's an issue with an apparent ISO character ½ that truncates the rest of the text upon insertion into a column with UTF-8 specified. Lets say that my string…
Paul Carlton
  • 2,785
  • 2
  • 24
  • 42
0
votes
1 answer

codepage conversion support on linux

I have two questions regarding codepages on linux. Is there any way to list out all the combination of codepages conversions possible on linux. If i have a file with data encoded in some format(say encode-1), i can use "iconv -f encode-1 -t…
0
votes
1 answer

Uploaded file char-set conversion with Ruby

I have an application where we're having our clients upload a csv file to our server. We then process and put the data from the csv into our database. We're running into some issues with char-sets especially when we're dealing with JSON, in…
rwilliams
  • 21,188
  • 6
  • 49
  • 55
0
votes
0 answers

Strange behavior of iconv() and utf8_decode() php methods

I have a test text which i post with and ajax call (JQuery): čéáűőúöüó é$ߤ÷׸¨¸˝¨´~˘˝°´˛>*čéáűőúöüó$>*ß$÷×÷;$¨˝´>$đ;ä i just write the very same text in the response
czupe
  • 4,740
  • 7
  • 34
  • 52