[Python.NET] passing unicode strings to dotnet-library using mono on ubuntu
fuzzyman at voidspace.org.uk
Fri May 16 00:18:55 CEST 2008
Ulrich Eck wrote:
> Hi there,
> i'm working with pyhtonnet to use features from itextsharp ( a dotnet
> pdf library).
> the purpose of the app is to fill out pdf forms from within a
> turbogears appserver.
> i tried several combinations of encodings and passing
> types to a utility function that sets the current pdf-form value with
> no success.
> i wrote a c# sample app that loads utf-8 encoded data and processes
> the pdf.
> then i ported it to ironpython with no problem (selecting data from
> sql-db and
> setting form-values in the pdfstamper).
> due to the lack of several essential std-lib modules i decided to use
> with mono within a linux/ubuntu server to access the itext library.
> basically everything is working - except that there is a problem with
> umlauts when passing values from result-sets to the dotnet library.
> the library methods dont accept pure str objects .. when i use unicode
> (correctly encoded)
> or SystemString objects the non-ascii chars wont display in the pdf or
> the resulting
> pdf is invalid (probably due to wrong encoding).
> i know that ironpython has a different string implementation .. is
> there a way how i can
> access the dotnet library that behaves similar to ironpythons
> implementation ?
IronPython basically doesn't have a string implementation at all - you
use native .NET strings (which correspond to Python Unicode strings)...
> any hints would be greatly appreciated
> yours Ulrich Eck
> Python.NET mailing list - PythonDotNet at python.org
More information about the PythonDotNet