Some UTF-8 Files Open As ANSI - Latin I

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
dchernik
Posts: 4
Joined: Wed Dec 24, 2014 4:04 am

Some UTF-8 Files Open As ANSI - Latin I

Post by dchernik »

Hi, I'm using TextPad 8.1.2 64-bit on Windows 10 1809.

I create exports using phpMyAdmin of 3 identically configured MySql WordPress databases as UTF-8 .sql files.

2 of them open with TextPad correctly as UTF-8 (Unix)

1 opens as ANSI - Latin I with all manner of corrupted characters.

Notepad opens all 3 files without problems as UTF-8, and all chars are Ok.

This appears to be a bug with TextPad specifically; please look into it. Thanks.
User avatar
kikosoft2
Posts: 28
Joined: Sun Apr 08, 2007 12:23 pm

Post by kikosoft2 »

This is a long standing issue with TextPad.

It happens because textpad tries to determine what the character encoding is when it opens a file. Whenever in doubt it uses ANSI, which is the default.

Adding a BOM to your UTF-8 files might help, but that might not be practical. For instance, PHP doesn't like BOM's.

What seems to help in my PHP file is when I add this line:

Code: Select all

// äöü (prevent textpad utf-8 loading bug)
but I do not garantee this. Check this forum for more help.

I do not expect Helios Software Solutions to solve this problem any time soon. The basis of this editor works in ANSI. The maker is English and therefore problably never needs to use anything but ANSI characters. I think Textpad is just a side-project, kept alive because there are some people who like it. I like it too, but wished it was better supported.
dchernik
Posts: 4
Joined: Wed Dec 24, 2014 4:04 am

Post by dchernik »

This actually works, thanks.

This particular file had only a few Unicode chars, so adding 3 more made a difference.

Open in Notepad (or even Word, I guess, which asks to confirm encoding), add the line, save, open with TextPad.
User avatar
AmigoJack
Posts: 532
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: Some UTF-8 Files Open As ANSI - Latin I

Post by AmigoJack »

dchernik wrote:Notepad opens all 3 files without problems as UTF-8, and all chars are Ok.
If the files have no BOM I think you're confusing Notepad with Notepad++.
User avatar
Nick
Posts: 51
Joined: Fri Aug 22, 2003 7:12 am
Location: Newcastle under Lyme, UK
Contact:

Post by Nick »

Seems to be working for me - stopping me tearing my hair out!

How does that code do it?
Cheers, Nick
www.square-sun.net
User avatar
ineuw
Posts: 191
Joined: Sun Mar 18, 2007 3:23 pm

Post by ineuw »

Check each document setup in Document classes, including the Default class and you will find the document that saves as ANSI.
TextPad 8.16.0 64bit in English and TextPad 9.1.0 64bit in French, on two separate Windows installations
Post Reply