Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ucs2 and ucs4 python

Reply
Thread Tools

ucs2 and ucs4 python

 
 
Alan Kesselmann
Guest
Posts: n/a
 
      05-15-2012
Hello

I tried using one compiled library and got this error:
ImportError: /home/alan/Downloads/pdftron/PDFNetC64/Lib/
_PDFNetPython2.so: undefined symbol: PyUnicodeUCS2_AsUTF8String

I googled around and found some info about the meaning of the error.
The creators of PDFNet suggested i install UCS2 python next to my UCS4
version to try their library.

Can someone point me towards a resource or two which will tell me how
to do this - im not very good with whole linux/servers stuff. Im using
ubuntu linux - if that makes any difference.

Alan
 
Reply With Quote
 
 
 
 
Miki Tebeka
Guest
Posts: n/a
 
      05-15-2012
> Can someone point me towards a resource or two which will tell me how
> to do this - im not very good with whole linux/servers stuff. Im using
> ubuntu linux - if that makes any difference.

Did not test, but this is the direction I would take:
* Download Python sources
* Open Terminal
* Run the following commands in the Terminal window
- sudo apt-get build-dep python
- tar -xjf Python-2.7.3.tar.bz2
- cd Python-2.7.3
- ./configure --prefix=/opt --enable-unicode=ucs2 && make
- sudo make install
* Now you should have /opt/bin/python with ucs2

HTH
--
Miki Tebeka <>
http://pythonwise.blogspot.com

 
Reply With Quote
 
 
 
 
zayatzz
Guest
Posts: n/a
 
      05-16-2012
On May 15, 7:42*pm, Miki Tebeka <miki.teb...@gmail.com> wrote:
> > Can someone point me towards a resource or two which will tell me how
> > to do this - im not very good with whole linux/servers stuff. Im using
> > ubuntu linux - if that makes any difference.

>
> Did not test, but this is the direction I would take:
> * Download Python sources
> * Open Terminal
> * Run the following commands in the Terminal window
> * - sudo apt-get build-dep python
> * - tar -xjf Python-2.7.3.tar.bz2
> * - cd Python-2.7.3
> * - ./configure --prefix=/opt --enable-unicode=ucs2 && make
> * - sudo make install
> * Now you should have /opt/bin/python with ucs2
>
> HTH
> --
> Miki Tebeka <miki.teb...@gmail.com>http://pythonwise.blogspot.com


Thanks for reply

And it seems to work... When i type in
/opt/bin/python
import sys
sys.maxunicode

then i get the desired answer - 65535

But it seems the work only begins now, because i cant use other python
libraries now with this version of python and i probably have to
install them all again somehow...

But thanks for your help

Alan
 
Reply With Quote
 
zayatzz
Guest
Posts: n/a
 
      05-16-2012
There is one problem though...

when i start script with shebang like
#!/opt/bin/python

and then try to run the script i get:

/opt/bin/python^M: bad interpreter: No such file or directory

/opt/bin/python
/opt/bin/python2
/opt/bin/python2.7 all start this new version of python, but none of
those work in shebang

Alan
 
Reply With Quote
 
Matej Cepl
Guest
Posts: n/a
 
      05-16-2012
On 16.5.2012 10:36, zayatzz wrote:
> /opt/bin/python^M: bad interpreter: No such file or directory


Your script has CRLF end-of-lines. Change it to plain Unix LF.

Matěj
 
Reply With Quote
 
zayatzz
Guest
Posts: n/a
 
      05-16-2012
On May 16, 11:50Â*am, Matej Cepl <mc...@redhat.com> wrote:
> On 16.5.2012 10:36, zayatzz wrote:
>
> > /opt/bin/python^M: bad interpreter: No such file or directory

>
> Your script has CRLF end-of-lines. Change it to plain Unix LF.
>
> Matěj


Thanks but i have no idea what that means or how to achieve that.

Alan
 
Reply With Quote
 
zayatzz
Guest
Posts: n/a
 
      05-16-2012
No need to answer that now, Dave explained this to me via personal
reply.

Thanks man!

And thanks again to everybody else
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: GSM to ISO / UCS2 to ISO Alexander Gattin Python 0 08-28-2010 12:33 PM
GSM to ISO / UCS2 to ISO James Mills Python 0 08-16-2010 10:01 AM
Unicode problem in ucs4 abhi Python 15 03-25-2009 01:51 PM
ucs2 or ucs4? Neal Becker Python 1 01-14-2008 01:03 PM
How to dectect UCS4 Python at runtime? Daniel Dittmar Python 2 08-07-2003 11:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57