Hallo,  sg. Herr Büchel,
da muss ich noch an die nicht korrigierte Version gekommen sein.
Hier die letzte berichtigte Version:

                                                      data coding and sending
  1.  read data:
  2.  write data:
  3.  menue:
  chose position >      1 / 2 / 3   > 1

 insert file >  ABCäöü߀𝄞
 inserted text
 ABCäöü߀𝄞
                                                 sending <index>data
  sequence of  <index>data:
 Ã,Ä,Å,ŧ,Ź,ſ,Ţ,2į,tơ,
 sequence of <original>data:
 ABCäöü߀𝄞

  sequence of <binary>data: 
000000000100000100000000010000100000000001000011000000001110010000000000111101100000000011111100000000001101111100100000101011001101000100011110
                             Die Sendung erfolgt mit der Datei:  binfolge.bin :

 Die <point>Zahlen des original Textes werden hier nicht mehr ausgegeben. Sie 
sind für die
kodierung auch nicht erforderlich, sondern nur noch für die Markierung auf der 
Tastatur.

mfg
Erich Schnoor

> Anfang der weitergeleiteten Nachricht:
> 
> Von: Wolli Buechel über python-de <python-de@python.org>
> Betreff: [Python-de] Re: Fwd: Codepage-Methode und Basis 4096
> Datum: 10. August 2024 um 18:36:43 MESZ
> An: python-de@python.org
> Antwort an: Wolli Buechel <wjb...@web.de>
> 
>> ABCäöü߀𝄞
>> <point>data 
>> 65 66 67 228 246 252 223 8364 119070 
>> number of bytes 12
> 
> Ihr Programm berechnet die Zahl der Bytes nicht korrekt.
> 
> Der String s = "ABCäöü߀𝄞" hat nicht 12 Byte, sondern 18 Byte:
> 
> ipython
> Python 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 
> 12.3.0]
> Type 'copyright', 'credits' or 'license' for more information
> IPython 8.26.0 -- An enhanced Interactive Python. Type '?' for help.
> 
> In [1]: s = "ABCäöü߀𝄞"
> 
> In [2]: [ ord(x) for x in s ]
> Out[2]: [65, 66, 67, 228, 246, 252, 223, 8364, 119070]
> 
> In [3]: [ list(bytes(x, 'utf8')) for x in s ]
> Out[3]: 
> [[65],
> [66],
> [67],
> [195, 164],
> [195, 182],
> [195, 188],
> [195, 159],
> [226, 130, 172],
> [240, 157, 132, 158]]
> 
> In [4]: [ len(bytes(x, 'utf8')) for x in s ]
> Out[4]: [1, 1, 1, 2, 2, 2, 2, 3, 4]
> 
> In [5]: sum([ len(bytes(x, 'utf8')) for x in s ])
> Out[5]: 18
> 
> W. Büchel
> _______________________________________________
> python-de Mailingliste -- python-de@python.org
> Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an 
> python-de-le...@python.org
> https://mail.python.org/mailman3/lists/python-de.python.org/
> Mitgliedsadresse: eschn...@multi-matrix.de

_______________________________________________
python-de Mailingliste -- python-de@python.org
Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an 
python-de-le...@python.org
https://mail.python.org/mailman3/lists/python-de.python.org/
Mitgliedsadresse: arch...@mail-archive.com

Reply via email to