AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

is the Value Unicode or Ansi

Ein Thema von randy_dom · begonnen am 19. Aug 2008 · letzter Beitrag vom 19. Aug 2008
Antwort Antwort
randy_dom

Registriert seit: 28. Apr 2008
17 Beiträge
 
#1

is the Value Unicode or Ansi

  Alt 19. Aug 2008, 20:28
Hi ,

How to detect if a File or a folder is a Unicode or Ansi with/out reading the BOM .

somthing like this :

Function IsUnicode(Value:String):Boolean;



Thanks
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: is the Value Unicode or Ansi

  Alt 19. Aug 2008, 20:29
Ohne Lesen des Dateiheaders wird es nicht gehen
Markus Kinzler
  Mit Zitat antworten Zitat
randy_dom

Registriert seit: 28. Apr 2008
17 Beiträge
 
#3

Re: is the Value Unicode or Ansi

  Alt 19. Aug 2008, 20:36
Zitat von mkinzler:
Ohne Lesen des Dateiheaders wird es nicht gehen
How ?
  Mit Zitat antworten Zitat
Benutzerbild von Bernhard Geyer
Bernhard Geyer

Registriert seit: 13. Aug 2002
17.171 Beiträge
 
Delphi 10.4 Sydney
 
#4

Re: is the Value Unicode or Ansi

  Alt 19. Aug 2008, 20:40
Read the first 3 Bytes of the file for the BOM
Windows Vista - Eine neue Erfahrung in Fehlern.
  Mit Zitat antworten Zitat
randy_dom

Registriert seit: 28. Apr 2008
17 Beiträge
 
#5

Re: is the Value Unicode or Ansi

  Alt 19. Aug 2008, 20:42
Zitat von Bernhard Geyer:
Read the first 3 Bytes of the file for the BOM
thank you Bernhard Geyer

Could you give me an example for that .
  Mit Zitat antworten Zitat
Benutzerbild von Bernhard Geyer
Bernhard Geyer

Registriert seit: 13. Aug 2002
17.171 Beiträge
 
Delphi 10.4 Sydney
 
#6

Re: is the Value Unicode or Ansi

  Alt 19. Aug 2008, 20:51
From JclUnicode.pas (JCL)

Delphi-Quellcode:
const
  BOM_LSB_FIRST = WideChar($FEFF);
  BOM_MSB_FIRST = WideChar($FFFE);


var
  BytesRead: Integer;
  Order: WideChar;
begin
  ...
    BytesRead := Stream.Read(Order, 2);
    if (Order = BOM_LSB_FIRST) or (Order = BOM_MSB_FIRST) then
   ...
end;
Windows Vista - Eine neue Erfahrung in Fehlern.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:49 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz