AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Suche nach String mit 'decomposed' Character
Thema durchsuchen
Ansicht
Themen-Optionen

Suche nach String mit 'decomposed' Character

Ein Thema von Maekkelrajter · begonnen am 6. Okt 2024 · letzter Beitrag vom 7. Okt 2024
Antwort Antwort
Seite 2 von 2     12   
Kas Ob.

Registriert seit: 3. Sep 2023
389 Beiträge
 
#1

AW: Suche nach String mit 'decomposed' Character

  Alt 7. Okt 2024, 09:40
After smoking a cigarette here few more notes
4) there is a nice yet a little complicate documentation for LOCALE_NAME on Windows OS
https://learn.microsoft.com/en-us/wi...l/locale-names
if you want to use multiple LOCALE then you only can do with sort so value can be
Zitat:
<language>
<language>-<Script>
<language>-<Script>-<REGION>
<language>-<REGION>\_<sort order>
when needed there it can be combined with
<language>-<REGION>-x-<custom> or <language>-<Script>-<REGION>-x-<custom>
The IETF BCP 47 mentioned there is complete standardized and future proof.
https://www.rfc-editor.org/info/bcp47

5) Notice that : I tried to stay away from the lengths of the parameters i passed to FindNLSStringX, because it can be tricky and easily can go wrong and cause overflow, generating wide range of problems from AV in the OS API to simple corrupted data, the reason is these functions require the length in chars, and here is the problem with this terminology, what is char ?
Is it render-able one or code unit which 2 bytes for Delphi by default and Windows also by default has 2 bytes WideChar, the troubles comes from using or mixing different API such as WideCharToMultiByte this one in particular can be very dangerous due its ability to handle almost everything, and by MultiByte you should never assume it is 2 bytes output or even input for that API.
The moral of this is to do as i do, prefer to stay away as far as you can from calculating the length or passing it, and try to stay on the safe side by leaning on using the null-terminating strings while passing (-1) as length, the API is safer that way.

Again hope that helps somebody !
Kas
  Mit Zitat antworten Zitat
Maekkelrajter

Registriert seit: 8. Mär 2017
Ort: Köln
157 Beiträge
 
Delphi 12 Athens
 
#2

AW: Suche nach String mit 'decomposed' Character

  Alt 7. Okt 2024, 12:35
Hi,
Wenn man weiß wie's geht, ist es tatsächlich trivial!
FindNLSString ist in der Tat die wirklich einfache Lösung.
Vielen Dank an alle Tippgeber, nicht zuletzt an Himitsu, aber vor allem Kas Ob., der mir mit seinem ausführlichen Beitrag entscheidend auf die Sprünge geholfen hat!

Once you know how to do it, it's actually trivial!
FindNLSString is indeed the really simple solution.
Many thanks to everyone who contributed good tips, not least to Himitsu, but especially to Kas Ob., who helped me significantly with his detailed contribution!

Gruß LP
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


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 00:28 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz