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

Call iconv from Ruby through system()

I have a problem with iconv tool. I try to call it from rake file in that way: Dir.glob("*.txt") do |file| system("iconv -f UTF-8 -t 'ASCII//TRANSLIT' #{ file } >> ascii_#{ file }") end But one file is converted partly (size of partialy…
Sebastian
  • 2,618
  • 3
  • 25
  • 32
0
votes
1 answer

Change UTF-8 Formatting to LATIN 2 via PHP

I have a simple problem. I am using iconv to convert UTF-8 to LATIN 2 liek this $res = file_put_contents($edi_path, iconv('utf-8', 'CP852', $html)); but the output file is win 1250 or by php detected as ISO and special characters are not…
user3175393
  • 109
  • 1
  • 10
0
votes
3 answers

unable to convert tab delimited .txt file to csv

I am using tr to convert tab delimited .txt file to comma delimited csv file. Here is my file output arron@arron-Ideapad-Z570 ~/Phd $ cat test_pph_s.txt | cut -f 1,2,3 #o_acc o_pos o_aa1 ENSG00000145888 455 …
brucezepplin
  • 9,202
  • 26
  • 76
  • 129
0
votes
1 answer

php, iconv() function error message

My text file contains the following string: "ãéðä". My PHP batch to convert that string goes like this: When I run the code I get the converted text I want . In a case i have more…
deotpit
  • 95
  • 1
  • 3
  • 12
0
votes
1 answer

Running iconv.exe with vbscript in Windows

When triyng to run iconv.exe under windows with the VBScript, the arguments don't go to executable. Set SHL = CreateObject("WScript.Shell") SHL.Run """iconv.exe"" -f utf-16 -t utf-8 in.txt > out.txt" I think it's error with quotes but can't find…
Von
  • 15
  • 3
0
votes
1 answer

MySQL UTF8 import behaves different across platforms

I need to import files extracted created on a Windows platform into a MySQL 5.5 database created and running on a Centos server. I develop the scripts on my OSX 10.9 laptop running a MySQL 5.5 database server. The files contain Dutch texts, so they…
hepabolu
  • 1,214
  • 4
  • 18
  • 29
0
votes
0 answers

Prepare sting for url containing slavic chars (Đ -> Dj and đ -: dj)

I want to translate strings containing latin slavic chars like "š, đ. č, ć" to a friendly url strings. Problem is with letter đ and Đ. protected function NameForUrl($name) { // Replace chars Đ, đ $string = $name; $pattern = '/([đ])+/'; …
Dušan
  • 488
  • 2
  • 9
  • 23
0
votes
1 answer

grunt.file.read replacing content to ...(length: xxxxx) in files with +10k chars

In my gruntfile, i'm using this code line to read a file, and assign his content to a variable: var content = grunt.file.read(file); The file reading action it's ok, but if the file is large, like +10K chars, it's shows the first +-10k of chars and…
dandapereira
  • 757
  • 5
  • 6
0
votes
1 answer

Iconv library multiple installations causing errors

I downloaded iconv yesterday, and installed it using: $ ./configure --prefix=/usr/local $ make $ make install When I tried to run iconv from the shell, I got a complaint that the shared object file is not found, so I executed export…
Innkeeper
  • 663
  • 1
  • 10
  • 22
0
votes
1 answer

How to convert a string from a given encoding to some other encoding?

I am not going to write any software that converts text between different character encodings. iconv exists. I just got curious to know how that can be done while reading this excellent tutorial on Character Encodings. Since, a character in…
kamalbanga
  • 1,881
  • 5
  • 27
  • 46
0
votes
1 answer

iconv with EBCDIC support on Cygwin

I installed iconv on Cygwin using the setup utility. The version information is as follows: $ iconv --version iconv (GNU libiconv 1.14) Copyright (C) ..... Written by Bruno Haible. However iconv -l is not showing any EBCDIC related codepages. Is…
Manoj
  • 58
  • 6
0
votes
0 answers

Tiny_tds gem on Ruby 2.0.0 fails - libiconv missing on Windows x64

It looks like a frequent error, but after 2 days, I still did not find the definite solution to this issue. I installed Ruby 2.0.0-p451 (x64) and DevKit (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe) from RubyInstaller for Windows. Ruby -v…
user1185081
  • 1,898
  • 2
  • 21
  • 46
0
votes
1 answer

libiconv on windows/linux issue

I need to perform character set conversion using iconv on windows. In this case this is transliteration to remove accents, etc. but the issue I am facing is the same for most any target encoding. Here is my Program: #include "stdafx.h" #include…
Tomasz Grobelny
  • 2,666
  • 3
  • 33
  • 43
0
votes
1 answer

Properly validate UTF-8 characters for insertion in a table with utf8_general_ci colocation

While the real problem is the colocation of the field on the database, i can't change it. I need to drop invalid characters instead. Using @iconv('utf-8', 'utf-8//IGNORE'); won't work, because the characters are valid UTF8 characters, but invalid…
cedivad
  • 2,544
  • 6
  • 32
  • 41
0
votes
1 answer

Linux C converting file from `UTF-16LE` to `ASCII` code hanging

I try to convert a UTF-16LE text file to ASCII using iconv but for some reason my code just hangs forever, any idea what am I doing wrong? #include #include #include #define S_SIZE (1024) #define bool int #define…
bsteo
  • 1,738
  • 6
  • 34
  • 60