Ooops
October 26, 2020, 01:01:41 AM

Author Topic: Windows 10 changed the character set of Blitz...  (Read 630 times)

Offline ampos

  • Jr. Member
  • **
  • Posts: 4
Windows 10 changed the character set of Blitz...
« on: April 27, 2020, 02:33:01 PM »
Hi!

I am using a POS program I did a long time ago.

I have been using it with no problem in WIndows 10, but since a week or two, some thing has changed in windows 10 that the special characters (like €, ñ, á,...) are shown wrongly.

I use (always) IDEal as my IDE. I can type 'print "€" ' and afer RUN, it will show a strange symbol. All special characters are shown wrong now.

Any one how to fix it? they look as cirylic (russian alphabet or similar)

Offline Derron

  • Hero Member
  • *****
  • Posts: 3234
Re: Windows 10 changed the character set of Blitz...
« Reply #1 on: April 28, 2020, 08:01:38 AM »
The editor of your choice might use some auto-detect file encoding widget.

Open the file in Notepad++ and check if it is encoded as utf8, iso*** or some cyrillic page encoding.


bye
Ron

Offline ampos

  • Jr. Member
  • **
  • Posts: 4
Re: Windows 10 changed the character set of Blitz...
« Reply #2 on: April 28, 2020, 11:06:00 PM »
It was windows that has changed... it was the same .exe file since december.

And now, since 2 weeks ago, it changed UTF.

The strange is that I have it running fine in a single WIndows 10 machine... perhaps it has not installed the magic update...

BTW, it has the same problem if the file is compiled using IDEal or the BB original IDE.

Offline Derron

  • Hero Member
  • *****
  • Posts: 3234
Re: Windows 10 changed the character set of Blitz...
« Reply #3 on: April 29, 2020, 06:55:24 AM »
So you have a compiled .exe - without any external file which you modified since compilation of this .exe ?
Asking as text files (eg ".ini" or wherever you store your texts for easier manipulation/localization) have file encoding settings which can make your programme display wonky characters for non-ascii-stuff).-

Is your .exe relying on some dynamic library? These Files could have been altered.



bye
Ron

Offline peteswansen

  • Jr. Member
  • **
  • Posts: 57
Re: Windows 10 changed the character set of Blitz...
« Reply #4 on: April 29, 2020, 05:55:08 PM »
A possibly unrelated thing I have seen........  when I copy a Blitz program from comments on Syntax Bomb or the Blitz code libraries,  I find that strange characters are inserted in the text....which of course are flagged as a error by the debugger.....

Offline Derron

  • Hero Member
  • *****
  • Posts: 3234
Re: Windows 10 changed the character set of Blitz...
« Reply #5 on: April 29, 2020, 06:22:59 PM »
What happens if you tried to paste into "notepad" first ("raw") and then copy + paste from there into your editor?
What happens if you tried copy + pasting from a different browser? (Firefox instead of Chrome or vice versa)

What does Notepad++ tell you regarding file encoding of the file you are saving?


bye
Ron

Offline ampos

  • Jr. Member
  • **
  • Posts: 4
Re: Windows 10 changed the character set of Blitz...
« Reply #6 on: April 29, 2020, 06:33:53 PM »
Yes, it has a very simple program. No external libraries, no nothing.

You can check this:

PRINT "€" (it can not be done)

To print the "€" I used to use PRINT CHR$(128); I use it on 3x Windows 10 computers. One computer changes it to some cirillic strange symbol around 3 weeks ago, the 2nd one, perhaps 1 week later changed to the same strange character. The 3rd computer is not yet "infected" (updated?) and shows the correct € symbol.

I have change the PRINT CHR$(128) to PRINT CHR$(136) so it shows the € symbol in the 2 infected :) ones... the uninfected shows another random character now :) some thing like this -> ^

To clarify, CPU#3 is the main one, and the folder with the program in #1 and #2 are just a plain backup "copy main:\\TPV to BACKUP:\\"

Try PRINT CHR$(128), will it print "€" or "strange character"?

So you have a compiled .exe - without any external file which you modified since compilation of this .exe ?
Asking as text files (eg ".ini" or wherever you store your texts for easier manipulation/localization) have file encoding settings which can make your programme display wonky characters for non-ascii-stuff).-

Is your .exe relying on some dynamic library? These Files could have been altered.


bye
Ron

Offline ampos

  • Jr. Member
  • **
  • Posts: 4
Re: Windows 10 changed the character set of Blitz...
« Reply #7 on: April 29, 2020, 06:38:06 PM »
The problem is not to change the € character, it is easily done.

But all my spanish special characters (like áéíóúñ) in the items description are shown with strange characters.

a$=INPUT("") ; I type "ñ", not "ñ" is shown on screen but a "weird character"
PRINT a$ ; it prints the "weird character"

Offline Derron

  • Hero Member
  • *****
  • Posts: 3234
Re: Windows 10 changed the character set of Blitz...
« Reply #8 on: April 30, 2020, 07:05:06 AM »
Chr(128) ... 128 is < 255. So you are relying on ASCII.
Certain Ascii-Chars (like the Euro sign or "umlauts") are not the same on all "encodings".

So for example the "euro sign" on all ASCII "interpretations":
https://www.eurosymbol.eu/ascii-code


In some of my codes I have this:
Code: [Select]
'special chars - recognized on Mac, but not Linux
'euro sign
?Linux
If KEYWRAPPER.pressedKey(69) And altGrPressed Then value :+ Chr(8364)
?


In my bitmap font class I have this to load "default" extra chars (not available in the first 255 chars):
Code: [Select]
'load glyphs of an imagefont as TBitmapFontChar into a char-TMap
Method LoadCharsFromSource(source:object=null)
local imgFont:TImageFont = TImageFont(source)
if imgFont = null then imgFont = FImageFont
Local glyph:TImageGlyph
Local glyphCount:Int = imgFont.CountGlyphs()
Local n:int
Local loadMaxGlyphs:int = glyphCount
if MaxSigns <> -1 then loadMaxGlyphs = MaxSigns

if extraChars = ""
extraChars :+ chr(8364) '€
extraChars :+ chr(8230) '…
extraChars :+ chr(8220) '“
extraChars :+ chr(8221) '”
extraChars :+ chr(8222) '„
extraChars :+ chr(171) '«
extraChars :+ chr(187) '»
'extraChars :+ chr(8227) '‣
'extraChars :+ chr(9662) '▾
extraChars :+ chr(9650) '▲
extraChars :+ chr(9660) '▼
extraChars :+ chr(9664) '◀
extraChars :+ chr(9654) '▶
extraChars :+ chr(9632) '■
endif

See how I load them via the unicode-codes?


So I bet your windows changed codepages from some ISO to another ISO variant or to UTF.

Edit:
https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings-winpc/window-10-keyboard-codepage-850-problem-after-1703/1fc56a99-6cd4-4ad7-831c-633a72813c39

bye
Ron

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal