Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hallo Zusammen,

ich habe Schwierigkeiten Sonderzeichen auf dem LCD auszugeben. Ich benutze hierfür die Funktion auto_to_ks0066u, wie sie auf der TF-Webseite zum download angeboten wird. rufe ich die Funktion auf

$lcd->writeLine(0, 2, auto_to_ks0066u("test äöüß"));

kommt auf dem Display nur mist (schwarze Pixel) oder der text ohne Sonderzeichen und anstatt der Sonderzeichen Fragezeichen an. der PHP Script gibt folgende Meldungen aus:

PHP Warning:  mb_convert_encoding(): Unable to detect character encoding in /var/www/Test.php on line 63

Uninitialized string offset: 18 in /var/www/Test.php on line 68

Uninitialized string offset: 19 in /var/www/Test.php on line 68

 

Die betreffenden Zeilen im Script sind:

$utf32le = mb_convert_encoding($string, "UTF-32LE", "auto");

(63)

$codePoint = ord($utf32le[$ii]) + ord($utf32le[$ii + 1]) * 256 + ord($utf32le[$ii + 2]) * 65536 + ord($utf32le[$ii + 3]) * 16777216;

(68)

 

Ich bin leider nicht so bewandert in PHP, ich vermute dass es irgendwie  mit der mb_convert_encoding() zusammenhängt.

Programmiere ich das ganze in Java funktioniert das Sonderzeichen umsetzen einwandfrei.

Meine Plattform ist ein Raspberry Pi mit Wheezy und php5.

Vielen Dank im Vorraus

Geschrieben

mb_convert_encoding wird hier benutzt um den String nach UTF-32LE zu konvertieren. Aus UTF-32LE kann ich dann die eigentlichen Unicode Codepoints ausrechnen. Dabei lasse ich PHP mit der auto option raten/ermitteln in welchem Encoding deine .php Datei und damit der "test äöüß" String ist.

 

Das Problem hier scheint zu sein, dass PHP nicht in der Lage ist das in deinem Fall zu bestimmen. Die Encodings die PHP unterstütz sind hier aufgelistet

 

http://www.php.net/manual/de/mbstring.supported-encodings.php

 

Du kannst jetzt versuchen deine .php Datei mit einem anderen Encoding zu speichern, bzw. auto hier

 

mb_convert_encoding($string, "UTF-32LE", "auto")

 

zum Encoding deiner .php Datei ändern.

Geschrieben
  • Autor

Hab beim Notepad++ die Kodierung auf UTF-8 umgestellt, jetzt frisst er's :)

vielen Dank

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.