iconv

Call to undefined function Symfony\Polyfill\Mbstring\iconv_strlen()

和自甴很熟 提交于 2019-12-03 17:30:40
问题 My project works fine on localhost but not working online and this is the error: Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strlen() in /home/stram/public_html/vendor/symfony/polyfill-mbstring/Mbstring.php on line 338 I googled it and I found that I need to install the PHP extension iconv . The problem that I'm using a VPS and when I went to the list of available PHP extensions I didn't found this extension ! Thnx in advance. 回答1: Symfony provides an iconv

Is it possible to use a gcc compiled library with MSVC?

若如初见. 提交于 2019-12-03 16:27:48
I have a project that relies on libiconv for several operations. I was using precompiled binaries for iconv.lib for Visual Studio 2008 but now I had to move on to Visual Studio 2010 and no more precompiled binaries were available. I decided to compile it myself but as the libiconv documentation states, there is no official support for MSVC compilers. However, I read somewhere that gcc could generate static libraries that were binary compatible with MSVC compilers, as long as the binary interface remains in C . While that sounded crazy, I gave it a try and it actually almost worked. I compiled

PHP, convert UTF-8 to ASCII 8-bit

ぐ巨炮叔叔 提交于 2019-12-03 15:07:05
I'm trying to convert a string from UTF-8 to ASCII 8-bit by using the iconv function. The string is meant to be imported into an accounting software (some basic instructions parsed accordingly to SIE standards). What I'm running now: iconv("UTF-8", "ASCII", $this->_output) This works for accounting software #1, but software #2 complains about the encoding. Specified encoding by the standard is: IBM PC 8-bit extended ASCII (Codepage 437) . My question is, what version of ASCII is PHP encoding my string into, and if other than specified - how can I encode the string accordingly to the standard

Why can iconv convert precomposed form but not decomposed form of “É” (from UTF-8 to CP1252)

…衆ロ難τιáo~ 提交于 2019-12-03 12:40:14
I use the iconv library to interface from a modern input source that uses UTF-8 to a legacy system that uses Latin1, aka CP1252 (superset of ISO-8859-1). The interface recently failed to convert the French string "Éducation", where the "É" was encoded as hex 45 CC 81 . Note that the destination encoding does have an "É" character, encoded as C9 . Why does iconv fail converting that "É"? I checked that the iconv command-line tool that's available with MacOS X 10.7.3 says it cannot convert, and that the PERL iconv module fails too. This is all the more puzzling that the precomposed form of the

Equivalent of Iconv.conv(“UTF-8//IGNORE”,…) in Ruby 1.9.X?

醉酒当歌 提交于 2019-12-03 09:19:46
问题 I'm reading data from a remote source, and occassionally get some characters in another encoding. They're not important. I'd like to get get a "best guess" utf-8 string, and ignore the invalid data. Main goal is to get a string I can use, and not run into errors such as: Encoding::UndefinedConversionError: "\xFF" from ASCII-8BIT to UTF-8: invalid byte sequence in utf-8 回答1: I thought this was it: string.encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "?") will replace

How do I link glibc's implementation of iconv?

本小妞迷上赌 提交于 2019-12-03 08:42:06
The GNU C library provides an implementation of iconv - how do I use it? Simple program: #include <iconv.h> int main( int argc, char **argv ) { iconv_t cd = iconv_open( "UTF-8", "ISO-8859-1" ); iconv_close( cd ); return 0; } Compile and link: $ gcc -Wall iconv.c -o iconv /tmp/ccKAfXNg.o: In function `main': iconv.c:(.text+0x19): undefined reference to `libiconv_open' iconv.c:(.text+0x29): undefined reference to `libiconv_close' collect2: ld returned 1 exit status List the symbols to show they exist! $ nm -D /lib/libc-2.12.1.so | grep iconv 00017920 T iconv 00017ae0 T iconv_close 00017720 T

iconv: Converting from Windows ANSI to UTF-8 with BOM

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to use iconv to convert files on my Mac. The goal is to go from "Windows ANSI" to "whatever Windows Notepad saves, if you tell it to use UFT8". This is what I want: anders-johansen-privats-macbook-pro:test andersprivat$ file names.csv names.csv: UTF-8 Unicode (with BOM) text, with CRLF line terminators This is what I use: iconv -f CP1252 -t UTF-8 names.csv > names.utf8.csv This is what I get (not what I want): file names.utf8.csv names.utf8.csv: UTF-8 Unicode text, with CRLF line terminators How do I get the BOM? 回答1: You can add it

解决Mac上打开txt文件乱码问题

孤者浪人 提交于 2019-12-03 07:59:32
   出处: https://www.jianshu.com/p/f55ddf1e9839   经常会在Mac上打开一个txt文件,发现里面的中文都是乱码,问题是在Windows和手机上看都完全是正常的,这就十分闹心了。网上千奇百怪的解决方案大多不能用,试错后发现一个解决方案。需要用到命令行工具iconv,语法是这样的: iconv -f encoding -t encoding sourcefile > destinationfile   比如一个典型的例子(也是大多数情况): iconv -f GB18030 -t utf-8 A.txt > B.txt   原文中是GB18030 > UTF8,不知为何会报错,改为utf-8后好用。   看看效果:   完全解决了我们的问题。又有了新的疑惑,why GB18030 > UTF8 ?   补充资料:   兼容性 GB2312:基本满足了汉字的计算机处理需要,对于人名、古汉语等方面出现的罕用字,GB 2312不能处理。 GBK:GBK 向下与 GB 2312 编码兼容,向上支持 ISO 10646.1国际标准。 GB18030 :对GB 2312-1980完全向后兼容,与GBK基本向后兼容,并支持Unicode(GB 13000)的所有码位。    发布时间 GB2312:由中国国家标准总局1980年发布

Convert Javascript UTF-8 to ASCII (like Iconv('UTF-8', 'ASCII//TRANSLIT', $string) in PHP)

和自甴很熟 提交于 2019-12-03 06:18:00
I'm wondering how it's possible to 'translate' characters in UTF-8 to the closest ASCII equivalent using Javascript, just like Iconv doest in PHP. Example: ü becomes u ó becomes o I'd rather not use a replace, because a) it requires a complete set of characters, which is a lot of work and b) i'd would be hard to get a complete set of characters, and i'll never be certain if i'm missing one or two. alexandernst As @Pointy said, your only option is to map/replace characters according to a dictionary. You'll find this really useful: https://github.com/backbone-paginator/backbone.paginator/blob

Converting ANSI to UTF-8 in shell

无人久伴 提交于 2019-12-03 06:16:01
I'm making a parser (1 csv to 3 csv) script and I have a problem. I am French so in my language I have letters like: é è à .... A customer sent me a csv file that Linux recognizes as "unknown-8bit" (ansi I guess). In my script, I'm writing 3 new csv files. But ViM creates them as ISO latin1 because it's close to what it got in the entry, but my é,è,à... are broken. I need UTF-8. So I tried to convert the first ANSI csv to UTF-8 : iconv -f "windows-1252" -t "UTF-8" import.csv -o import.csv The problem is that it breaks my CSV. It's now on only one row. But my special chars are ok. Is there a