Character set conversion related to Libiconv

zhaozj2021-02-16  74

Character set conversion related to Libiconv's question? ? http://www.chinaunix.net Author: lixiaosi Posted: 2003-11-17 16:06:46

Iconv_open ("Unicode", "GB2312") function, I run normal under Linux, then I will report it wrong with Solaris, I checked the information, saying is the problem of libiconv, then I will see the relevant information Libiconv installation, how is this Libiconv? installation? As usual for GNU packages: $ ./configure --prefix = / usr / local $ make $ make install After installing GNU libiconv for the first time, it is recommended to recompile and reinstall GNU gettext, so that it can take advantage of libiconv . On systems other than GNU / Linux, the iconv program will be internationalized only if GNU gettext has been built and installed before GNU libiconv. This means that the first time GNU libiconv is installed, we have a circular dependency between the GNU libiconv and GNU gettext packages, which can be resolved by building and installing either * first libiconv, then gettext, then libiconv again, or (on systems supporting shared libraries, excluding AIX) * first gettext, then libiconv, then gettext again. 1. how this libiconv Installation, right? #ls libiconv-1.9.1.tar #tar -xvf libiconv-1.9.1.tar #cd libiconv-1.9.1 #. / configure #make #make install "--prefix = / usr / local" This configuration parameter is ? How to write, I hope you can enlighten it! ? ? 3. Can you see the information of the two libraries of Libiconv and GetText with pkginfo? How to see? Can you see if there is a libiconv library before installation? ? [Post Reply] [View CU Forum original] [close]

Lixiaosi Reply to: 2003-11-17 17:59:55 No one will?

Gadfly Reply to: 2003-11-17 22: 20: 24Gettext is a GNU package, you can download the binary package installation on SunFreeWare.com. / usr / local should be the default path, and it doesn't matter if it doesn't matter. You have a post I have returned, give two links, should there be installation and instructions?

Lixiaosi Reply to: 2003-11-18 09: 40: 03gadfly moderator, finally ask a completely installed problem, I analyze the fully installed steps in accordance with the documentation provided by the GNU: 1. #LS Libiconv-1.9.1.tar .gz gettext-0.12.1.tar.gz #tar -zxvf libiconv-1.9.1.tar.gz #tar -zxvf getText-0.12.1.tar.gz #cd libiconv-1.9.1 #. / configure - Prefix = / usr / local #make #make install 2. #CD getText-0.12.1 #ls gettext-0.12.1 #. / configure --prefix = / usr / local #make #make install 3. #CD libiconv- 1.9.1 #ls libiconv-1.9.1 # make distclean #. / Configure --prefix = / usr / local #make #Make Install The full installation steps?

Lixiaosi Reply to: 2003-11-18 11:20:19 I installed in the above method, no success, error is as follows: # make install builddir = "` pwd` "; cd libcharset && make all& make install-lib libdir = "$ builddi r / lib" includeir = "$ builddir / lib" make [1]: Entering Directory `/usr/temp/libiconv/libiconv-1.9.1/libcharset 'CD LIB && Make All Make [2]: Entering Directory `/usr/temp/libiconv/libiconv-1.9.1/libcharset/lib '/ bin / sh ../libtool --mode = link gcc -o libcharset.la -rpath / usr / local / lib -vers ion-info 1: 0: 0 -No-undefined localcharset.lo relocatable.lo rm -fr .libs / libcharset.so .libs / libcharset.so.1.libs / libcharset.so.1.0.0 gcc -shared -wl, -h -Wl, libcharset.so.1 -o .libs / libcharset.so.1.0.0 .libs / local charset.o .libs / relocatable.o -lc (cd .libs && rm -f libcharset.so.1 && ln -s libcharset.so.1.0.0 libcharset.so.1) (cd .libs && rm -f libcharset.so && ln -f libcharset.so && ln-s libcharset.so) False Cru .libs / libcharset.a localcharset .o relocatable.o make [2]: *** [libcharset.la] error 1 make [2]: Leaving Directory `/ usr / temp / libiconv / libiconv -1.9.1 / libcharset / lib 'make [1]: *** [all] error 2 make [1]: Leaving Directory `/uSR/temp/libiconv/libiconv-1.9.1/libcharset' make: *** [lib / localcharset.h] Error 2 This is why, how can I have successful installation? Lixiaosi Reply to: 2003-11-18 16:32:06 I saw the source code compilation, just downloaded getText-0.11.5-Sol9-sparc-local.gz and libiconv-1.8-Sol9 from www.sunfreeware.com. -sparc-local.gz installation, or reported before: iconv_open () :: invalid argument I really helpless, who can help? ?

Gadfly Reply to: 2003-11-18 16: 43: 20 Sorry, last time is not your post. Oh, the problem is almost the same. I thought it was you asked. Http://chinaUnix.net/forum/viewtopic.php?t=200502 You can ask Heartk to see her solving. The default may not. I will try it with the source code installation. Try to tell you the result of Lixiaosi Reply to: 2003-11-18 16:51:10 Good first!

Gadfly Reply to: 2003-11-18 17:40:18 I installed it, it should be a lot. Methods as below. 1. Download GetText and Libiconv pay from SunFreeware, is a binary installation package, not the source package 2, Gunzip, two packages, then pkgadd -d gettext * pkgadd -d libiconv * 3, export path = / usr / local / bin: $ PATH This purpose is to use the gnu's iconv instead of Iconv comes with the iconv from Solaris. You can test it. $ Iconv -l | grep -i uTF UTF-8 UTF-16 UTF-16BE UTF-16LU UTF-32 UTF-32BE UTF-32LE UNICODE-1-1-UTF-7 UTF-7 CSUNICODE11UTF7 $ iconv -l | GREP - I Unicode ISO-10646-UCS-2 UCS-2 CSUNICODE UCS-2BE UNICODE-1-1 UnicodeBig CSUNICODE11 UCS-2LE UNICODELITLE UNICODE-1-1-UTF-7 UTF-7 CSUNICODE11UTF7 You will find this iconv is support UTF-16 of. I remember that Unicode refers to UTF-16, so command line test, you can use $ iconv -f gb2312 -t utf-16 your_data_file compared to Solaris / usr / bin / iconv -f GB2312 -T UTF-16 Test_ConV .C an error. Note that the above should not be tested after step 4, otherwise the library is GNU, it will not report an error. 4, export ld_preload = / usr / local / lib / libiconv_plug.so This is to replace the default Iconv library function of libc, so you test the source code to write iconv_open ("UTF-16", "GB2312"); or iConv_open ("GB2312", "UTF-16"); need to bring -Liconv when compiling

Lixiaosi Reply to: 2003-11-18 18:06:27 High people, I will not have problems in accordance with the steps you said. Prouked me a week, I finally solved me, I don't know what to say, I still have to say thank you thank you! good luck! !

Gadfly Reply to: 2003-11-18 18:29:32 huh, I will eat it. Often someone asked iConV related issues, there is time to organize relevant posts. It is exciting to check it out for

Lixiaosi Reply to: 2003-11-19 09:29:07 line, no problem, huh

Lixiaosi Reply to: 2003-11-19 11: 14: 18gadfly, there is a problem, I add this in my environment: ld_preeload = / usr / local / lib / libiconv_plug.so; export ld_preeload then in the environment With ld_preeload = / usr / local / lib / libiconv_plug.so then I view the user process, just like this: $ ps ld.so.1: ps: Fatal: /usr/local/lib/libiconv_plug.so: Wrong Elf Class: Elfclass32 Killed $ PS-EF | grep hhf ld.so.1: ps: Fatal: /usr/local/lib/libiconv_plush.so: Wrong Elf Class: Elfclass32 $ then I put this line in the environment LD_PRELOAD = / usr / Local / lib / libiconv_plug.so; export ld_preload is blocked, see the process is fine, is it no problem? After I lost this line, I continued to run the procedure for UTF-16 and GB2312 conversion, still no problem? Why is this? Lixiaosi Reply to: 2003-11-19 14: 44: 08 $ SQLPLUS SYS / SYS SQL * PLUS: Release 8.1.7.0.0 - Production On WED NOV 19 14:07:30 2003 (c) Copyright 2000 Oracle Corporation. All . rights reserved ld.so.1: oraclekgl: warning: /usr/local/lib/libiconv_plug.so: open failed: illeg al insecure pathname Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production With the Partitioning option JServer Release 8.1.7.0.0 - 64bit Production $ su root ld.so.1: su: warning: /usr/local/lib/libiconv_plug.so: Open Failed: Illegal INSE CURE PATHNAME Password: # Once ld_preeload = / usr /LOCAL/LIB/LIBICIONV_PLUG.SO is addressed in the environment, which is the warning, why? ?

Lixiaosi Reply to: 2003-11-19 16: 56: 05gadfly, is I installed pkgadd -d gettext * pkgadd -d libiconv * When two packages, I use the root user and my executive user makes users HHF, is this two packs that should be installed with HHF users? ?

Lixiaosi Reply to: 2003-11-19 17:12:00 should not, I put ld_preeload = / usr / local / lib / libiconv_plug.so; export ld_preload adds to the environment variable of the root user, the same thing appears above Strange

Gadfly Reply to: 2003-11-19 20:37:07 Two Measures: 1, press the above method to recompile, run LDD your_program, do you see if there is libiconv.so.2 => / usr / local / lib / Libiconv.so.2 like this. If so, run Your_Program after you will not be necessary to export this environment variable. 2, if you don't have a startup script, Wrapper Your_Program. In the script, execute this environment variable before executing your program, after execution, UNSET environment variables, this will not have problems. Lixiaosi Reply to: 2003-11-20 11:18:08 I follow what you said, do it, 1. I didn't add LD_PRELOAD = / usr / local / lib / libiconv_plug.so and then did $ ldd send libsocket.so.1 => /usr/lib/libsocket.so.1 libnsl.so.1 => / USR / LIB / LIBNSL.SO.1 LIBICIONV.SO.2 => /usr/local/lib/libiconv.so.2 libc.so.1 => /usr/lib/libc.so.1 libdl.so.1 => /Usr/lib/libdl.so.1 libmp.so.2 => /usr/lib/libmp.so.2 /usr/platform/sunw ,undraax-i2/lib/libc_psr.so.1 $ display Libiconv.so.2 => /usr/local/lib/libiconv.so.2 is not necessary to add ld_preeload = / usr / local / lib / libiconv_plug.so, yes, huh, huh 2. This script shell is very simple, Write, huh, just already have the above, don't write this shell. Oh, thank you gadfly libiconv_plug.so and libiconv.so.2, these two libraries have inevitable connection? Don't understand why is it already in the environment?

Lixiaosi Reply to: 2003-11-20 13:15:06 I now have questions about the referenced header file, I write this way in my head file: #include and #include "/ usr / local / INCLUDE / ICONV.H "The two ways to be compiled are the same, and there is no problem. Then I do this $ LDD Server can display libiconv.so.2 => /usr/local/lib/libiconv.so. 2 I don't understand: #include The referenced will always be the header file under / usr / include, why can I use the program compiled with this header file? ?

Gadfly Reply to: 2003-11-20 20: 48: 391, the header file is only required, and there is no relationship with the run, so as long as the interface of the library function is the same, the header file uses which does not matter. 2. If the program is running, the function (if any) in the dynamic library specified by LD_PRELOAD will be called, and the function in the dynamic library specified by the default link. Since your program has specified this dynamic library, you don't have this environment variable. I estimate that the two dynamic libraries are the same. If this environment variable is specified, it will also affect other programs. If there is a different interface, or if there is a system security check, it will report an error or issue a warning. So if you want to use it, try to reduce the impact range. Very happy Reply to: 2003-11-21 11: 38: 13LIBICIONV can only be called once? ×××

Lixiaosi Reply to: 2003-11-21 18:00:52 Thank you! Thoroughly solved huh!

转载请注明原文地址:https://www.9cbs.com/read-16854.html

New Post(0)