Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

String in wchar_t umwandeln

Empfohlene Antworten

Veröffentlicht

hallo. ich hab jetzt schon einige zeit gesucht, aber irgendwie immer nur sachen gefunden, die bei mir nicht so recht funktioniert haben. folgendes problem:

ich will einen String in ein wchar_t umwandeln und das so einfach wie möglich. meine c++ kenntnisse halten sich leider sehr in grenzen, deswegen wäre ich euch sehr dankbar, wenn ihr mir mit einem kompletten codebeispiel (incl. aller include anweisungen etc.) helfen könntet.

mfg Tobias

also, das ganze kommt ursprünglich aus einer java datei, ist also ein jstring. umwandeln kann ich ihn in ein const char *. und daraus muss ich nun ein wchar_t machen.....

JNIEnv::GetStringUTFChars

const jbyte* GetStringUTFChars(JNIEnv *env, jstring string,

jboolean *isCopy);

Returns a pointer to an array of UTF-8 characters of the string. This array is valid until it is released by ReleaseStringUTFChars().

If isCopy is not NULL, then *isCopy is set to JNI_TRUE if a copy is made; or it is set to JNI_FALSE if no copy is made.

Alternativ GetStringChars(), dann hat er es gleich als Unicode.

jbyte dürfte simultan zu char sein, von daher dürfte das nichtmal nen Cast benötigen.

Und wie man char zu wchar_t macht steht ja oben im Link. :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.