[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] python utf8 problem



> Martin Skøtt wrote:
>> Har du prøvet at tage et kig på encode() og decode()
>> metoderne, som findes op String objekter?
>
> Jeg har kigget på dem men jeg syntes ikke at
> s=encode("utf8-streng","UTF-8") giver nogen mening, men
> jeg har ikke forsøgt det.
>
> Det jeg vil er at komme fra "UTF8 streng" til u"UTF8 streng"
> uden de/en-coding.


Hmm... prøv at kalde unicode() metoden med strengen og din encoding som
argumenter:

>>> print unicode.__doc__
unicode(string [, encoding[, errors]]) -> object

Create a new Unicode object from the given encoded string.
encoding defaults to the current default string encoding and
errors, defining the error handling, to 'strict'.

Det er vel noget nær det nærmeste man kan komme på et typecast i Python :)

MvH

Martin Skøtt


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *