Accented characters (Spanish, Hungarian etc...)
in
Programming Questions
•
2 years ago
Hi Everyone,
I was wondering if there was a way to display accented characters properly when they are being loaded from a .txt file. If I try to print accented chars written in the code, they print just fine, but when they are being loaded from a .txt file, they wont show. Here's my sample code, it demonstrates the problem well:
lines.txt contains this single line: "lines.txt: ö, ü, ó, ú, ő, ű, á, é, í"
Any help would be appreciated!
Thanks,
Ben
I was wondering if there was a way to display accented characters properly when they are being loaded from a .txt file. If I try to print accented chars written in the code, they print just fine, but when they are being loaded from a .txt file, they wont show. Here's my sample code, it demonstrates the problem well:
- size(screen.width,screen.height);
- background(255);
- fill(0);
- textFont(createFont("Calibri",50),50);
- textAlign(CENTER,CENTER);
- String[] lines=loadStrings("lines.txt");
- if(lines.length>0) {
- text(lines[0],width/2,height/2);
- }
- else {
- text("chars from code: ö, ü, ó, ú, ő, ű, á, é, í",width/2,height/2);
- }
lines.txt contains this single line: "lines.txt: ö, ü, ó, ú, ő, ű, á, é, í"
Any help would be appreciated!
Thanks,
Ben
1