PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Problem with Texfiles in UTF
Problem with Texfiles in UTF
Débuté par Stephan Wiestner (swissstephan), 12 jan. 2006 10:08 - 3 réponses
Posté le 12 janvier 2006 - 10:08
Hello
My newest problem is I receive a text file with Filenames in it unfortunately in UTF. I tried all commands documented in the help-File, but it doesn't work. Can anyone tell me how i can open an utf-file, read the textline and translate it to ansicode. At the moment I use
- lcline =Replace(lcline,"ä","ä")
but there are so many special chars in the world, I can't find all of them.
Thanks and kind regards
Stephan
Posté le 12 janvier 2006 - 11:59
Just to be more precise it's UTF-8
Hello
My newest problem is I receive a text file with Filenames in it unfortunately in UTF. I tried all commands documented in the help-File, but it doesn't work. Can anyone tell me how i can open an utf-file, read the textline and translate it to ansicode. At the moment I use
- lcline =Replace(lcline,"ä","ä")
but there are so many special chars in the world, I can't find all of them.
Thanks and kind regards
Stephan
Posté le 12 janvier 2006 - 12:12
Hi,
My newest problem is I receive a text file with Filenames in it unfortunately
in UTF. I tried all commands documented in the help-File, but it doesn't
work. Can anyone tell me how i can open an utf-file, read the textline and
translate it to ansicode. At the moment I use

[...]
Try the UnicodeToAnsi() & AnsiToUnicode() functions with the charsetUTF8
parameter.
--
Peter
Posté le 13 janvier 2006 - 07:49
Peter thanks for this idea! This small routine does the job. Thanks again!
PROCEDURE UTF8Replace(pcline)
lcline is string = pcline
lcunicodeline is string UNICODE = AnsiToUnicode(lcline,charsetUTF8)
lcline = UnicodeToAnsi(lcunicodeline,charsetCurrent)
RESULT lcline