Just starting out? Need help? Post your questions and find answers here.
highend
Enthusiast
Posts: 169 Joined: Tue Jun 17, 2014 4:49 pm
Post
by highend » Mon Sep 01, 2025 12:11 pm
Hi,
something's very odd atm...
PureBasic v6.21 x64 (IDE), Compiler: v6.04 LTS x64
Code:
Code: Select all
Debug "D:\250807_Analyse_Bereinigung_Pfadlängen_Files.txt"
The .pb file is UTF-8 with BOM.
I get this output:
Why is that?
infratec
Always Here
Posts: 7613 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Mon Sep 01, 2025 12:39 pm
It does exactly what it should.
It prints the string which you added behind.
What does you expect?
highend
Enthusiast
Posts: 169 Joined: Tue Jun 17, 2014 4:49 pm
Post
by highend » Mon Sep 01, 2025 12:42 pm
No it doesn't
The string to output contains "ä" but the output doesn't display an "ä" but an "a" followed by an "n" with some dots above it
infratec
Always Here
Posts: 7613 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Mon Sep 01, 2025 12:47 pm
My output looks like this:
D:\250807_Analyse_Bereinigung_Pfadlängen_Files.txt
What language is used for the IDE? In my case it is german.
And in settings, what is your font for the debug window? I use consolas west
Last edited by
infratec on Mon Sep 01, 2025 12:49 pm, edited 1 time in total.
Fred
Administrator
Posts: 18199 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Mon Sep 01, 2025 12:49 pm
Is your file in UTF-8 format ? You can check in Menu File -> File Format -> UTF8
highend
Enthusiast
Posts: 169 Joined: Tue Jun 17, 2014 4:49 pm
Post
by highend » Mon Sep 01, 2025 12:55 pm
What language is used for the IDE? In my case it is german.
And in settings, what is your font for the debug window? I use consolas west
My IDE is set to english and the (custom) font used for the debug window is Consolas (which never had issues to display german special chars). Changing it to Segoe UI doesn't change the weird display of that string.
Is your file in UTF-8 format ? You can check in Menu File -> File Format -> UTF8
Yes it is. Encoding: Utf8
infratec
Always Here
Posts: 7613 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Mon Sep 01, 2025 12:59 pm
What's the output if you open a new code window and put this debug line inside, without anything else?
(That's what I did)
highend
Enthusiast
Posts: 169 Joined: Tue Jun 17, 2014 4:49 pm
Post
by highend » Mon Sep 01, 2025 1:03 pm
Still the same output
infratec
Always Here
Posts: 7613 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Mon Sep 01, 2025 1:05 pm
That's very strange, because here it works correct.
Forget the following...
In reality, the path is in a variable isn't it?
Use
Code: Select all
ShowMemoryViewer(@path$, StringByteLength(path$))
Last edited by
infratec on Mon Sep 01, 2025 1:07 pm, edited 2 times in total.
Fred
Administrator
Posts: 18199 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Mon Sep 01, 2025 1:06 pm
Tried here with consolas as well and it works as expected. Strange issue for sure !
infratec
Always Here
Posts: 7613 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Mon Sep 01, 2025 1:08 pm
Or please try that:
Code: Select all
path$ = "D:\250807_Analyse_Bereinigung_Pfadlängen_Files.txt"
Debug path$
ShowMemoryViewer(@path$, StringByteLength(path$))
61 00 64 00 6C 00 E4 00 6E 00 67 00 65 00 6E 00 a.d.l.ä.n.g.e.n.
The ä is represented by 00 E4 (E4 00)
highend
Enthusiast
Posts: 169 Joined: Tue Jun 17, 2014 4:49 pm
Post
by highend » Mon Sep 01, 2025 1:11 pm
When I change it to "String View (Unicode)" the output is correct (as well in Hex View)^^
Kiffi
Addict
Posts: 1497 Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9
Post
by Kiffi » Mon Sep 01, 2025 1:13 pm
Just a guess: Did you copy the path from somewhere into the clipboard and paste it into the IDE? What happens when you type
?
Hygge
infratec
Always Here
Posts: 7613 Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany
Post
by infratec » Mon Sep 01, 2025 1:15 pm
Please use 'Hex' so that the codes of the characters are visible.
highend
Enthusiast
Posts: 169 Joined: Tue Jun 17, 2014 4:49 pm
Post
by highend » Mon Sep 01, 2025 1:25 pm
Just a guess: Did you copy the path from somewhere into the clipboard and paste it into the IDE? What happens when you type
The guess is correct...
When I copy your "äöüÄÖÜ" here from the forum into the IDE, the output is correct, when I do the same with the path I posted, it is shown correctly. If i copy it out of the my editor (Sublime Text) or from the file manager, it's not correct...