![]() |
|
Print strings with accents and special chars - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Print strings with accents and special chars (/showthread.php?tid=4185) |
Print strings with accents and special chars - Ikerkaz - 12-03-2025 Hi to all !!! I have a little program that reads the contents of a folder (with _FILES$ function), then stores them in a string array, and finally it prints all the array on screen. My problem is that I have accents and special chars on names (I am from Spain, we have Ñs and á é í ó ú). I tried with _UPrintString (x, y), NAME(i), , 8,font ... but it only works with standard file names with no accents ![]() If the name has no special chars it shows the name correctly, but with accents or Ñs it shows an empty string. What am I doing wrong? Thank U very much !!!
RE: Print strings with accents and special chars - SMcNeill - 12-03-2025 First question: Have you loaded a font with the Unicode characters in it with _LoadFont and _Font? RE: Print strings with accents and special chars - Ikerkaz - 12-03-2025 Yes, I am using Arial Narrow Font = _LoadFont("C:\WINDOWS\FONTS\ARIALNB.TTF", 20) RE: Print strings with accents and special chars - Petr - 12-03-2025 Use _MapUnicode with correct data block for Spain. Press Shift +F1 in IDE then alphabetical/ _mapunicode and search your code page data block and example program. RE: Print strings with accents and special chars - Ikerkaz - 12-03-2025 I tested this program: Code: (Select All)
It shows correctly the special chars, but I don't know how to adapt it to my program I tried to _MAPUNICODE before writing on screen my file names, but it is not working, it is showing blank strings (if the string has special chars)
RE: Print strings with accents and special chars - Ikerkaz - 12-03-2025 I've reduced my program to the bare minimum, in order to try several printing options: Code: (Select All)
This is my result: ![]() But this is the original file name:
RE: Print strings with accents and special chars - RhoSigma - 12-03-2025 Try using the DATA values for codepage Win-1252 instead of Pc-850. https://qb64phoenix.com/qb64wiki/index.php/Code_Pages#CP_1252 RE: Print strings with accents and special chars - Ikerkaz - 12-03-2025 (12-03-2025, 02:09 PM)RhoSigma Wrote: Try using the DATA values for codepage Win-1252 instead of Pc-850. IT WORKS !!!!!!!!!!!!!!!!! THANK YOU VERY MUCH !!!!!!!!!!!
RE: Print strings with accents and special chars - TempodiBasic - 12-20-2025 yeah in the years this question about portability of screen output and keyboard or file input runs over and over. Maybe it must be showed into FAQ of wiki so the solution is visible for all new users... I remember that at the time of QB64 SDL I got the help of Clippy and then from another Czech user(sorry my bad memory doesn't let me remember his name) that showed me how to performing the task by using _mapunicode. Some years after I collaborated with Steve to map keyboard input with _deviceinput(1). I got and published in that thread the set for Italian and West Europe code set. |