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.

[VB 6] Datei erstellen in Unicode UTF 8

Empfohlene Antworten

Veröffentlicht

Hallo,

ich möchte mir in einem kleinen Projekt eine Datei im Unicode UTF 8 erstellen. Weder mit OPEN oder FSO habe ich die möglíchkeit dies anzuwählen. Lediglich bei FSO habe ich die Auswahl für Unicode oder nicht. Da wird mir aber Unicode 16 sretellt. Muss ich da was in den Einstellungen ändern? Bitte helft mir.

Danke

VB 6 und FSO unterstützen von haus aus kein UTF-8, du musst mit streams arbeiten:


Private Sub CreateFile(ByVal pstrFile As String, ByVal pstrData As String)


  Dim objStream As Object


  'Create the stream

  Set objStream = CreateObject("ADODB.Stream")


  'Initialize the stream

  objStream.Open


  'Reset the position and indicate the charactor encoding

  objStream.Position = 0

  objStream.Charset = "UTF-8"


  'Write to the steam

  objStream.WriteText pstrData


  'Save the stream to a file

  objStream.SaveToFile pstrFile


End Sub

s'Amstel

kannst du mir diesen Code bitte etwas näher erklären?! Mein ziel ist es eine Datei zu erstellen wo ich Zeile für Zeile aufbereiten kann und dann wegschreiben.

Wäre super von Dir!!

der code ist eh kommentiert, wo ist das problem? ;)

lies dir mal die dokumentation zum streamobjekt durch, dann wirst du draufkommen, dass die methode WriteText einen parameter erlaubt, um zeilenwiese in den stream zu schreiben.

s'Amstel

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.