[Bug Report] Pnach reader breaks on non-ANSI
#1
(The topic is supposed to read non-ASCII, not ANSI... my bad)

Tested with pcsx2 r5617. No speedhacks (not that it matters).

It took me an hour and a lot of frustration to figure this one out. I tried to load a couple of code lines with comments in any kind of permutation, with patch=1 and 0, word or extended, nothing worked. PCSX2 log would say it found the .pnach file, but loaded 0 cheats.

I then used the PCSX2CE tool to create a pnach file with the exact same codes for me... and they loaded. I was baffled, and started adding some random comments to the CE file. Still worked. Until... I added an umlaut ion one of the comment lines. So:

# Bug: An umlaut like ä ö ü (and i guess any non-ASCII character?) breaks all codes that come after it in a patch file.

I'm not asking for UTF support here, that would probably complicate things more than it needs to, but mybe implement the nowadays common full 8-bit range of characters like in ISO-8859-1 or -15.
Reply

Sponsored links

#2
It's not a bug and making the parsing aware of every region is daunting work. What happens is due to the editor you use. Is advisable avoiding MS products, download an editor called Notepad++ and set it as default program for almost everything from simple txt to computer language files, believe me you will wont wish to get near MS notepad once again.

Besides it has plugins for an incredible range of extra features, from support to custom "languages" (so it can highlight special words and such) to things like Compare which is wonderful to verify differences between files, and much more.

That's much better than asking to adapt for those puny MS tools. Ah, before I forget, it's not because region and UTF-8 actually, Notepad++ is able to work with both without messing things.

Most probably you were editing under some rich text editor.

PS: Just as example of custom language i mentioned above, modders made one so it would edit Oblivion script language with all the special words not only for the original set as those introduced by OBSE and updated every time OBSE itself was.

Not to mention you can change the encode to whatever you want from it's "Encoding" menu.
Imagination is where we are truly real
Reply
#3
What's up with that rant? I'm not part of your crusade against Microsoft, i never even mentioned it. For all you know, i'm using Linux.

And just so you know, ANSI *is* actually the default character set in Notepad++. So yeah, you will break the pnach reader even with your beloved Notepad++. It has nothing to do with "regions" or something like that either, it's been basically the common ASCII enchancement for ten years or so. UTF-8 is something completely different.

It's a large potential source of errors, considering that probably half or more of the pcsx2 userbase are not from an English-speaking country. I guess an UTF parser would be a nice concession to the Asian users, but just ANSI will include most or all special characters of European languages.


(Also, screw Notepad++, use Notepad2. Much faster and less bloated.)
Reply
#4
He only tries to help you and Notepad++ isn't bloatware, don't know where you get that from, cause I've used that software for years and it never installs any crap.
Reply
#5
Dude needs to calm down. Or get his attitude adjusted.

Word of advice... next time you decide to post a problem in a forum, dont get all agro over a response aimed at helping you.
[Image: jmt41l-2.png]
SSD: 250GB | HDD: 2TB | GPU: MSI GTX 970 4G Gaming
Reply
#6
PCSX2CE had(still has apparently;p) some own problems with unicode. I usually use that program only to add formatting and then save the file in notepad cause I dislike using gametitle line which isn't pcsx2 specific and have no problem at all. If you do save manually like that and select unicode you can use your german, chinese or whatever other specific signs at will without problems and codes will be recognized(I even tested it to be sure now), hence it's not pcsx2 bug.
Reply
#7
Anyway, Krude, do how you want. Notepad++ was only a suggestion, it has far more resources than MS Notepad and none the possible differences at treating control codes, like NL FB with sad history.

Anyway, the actual problem was already addressed, the emulator actually parses Gametitle so to print it, I should have recalled that possibility.
Imagination is where we are truly real
Reply
#8
That sure exploded. I wasn't trying to attack nosisab or his white knights. I'm just kind of weirded out by the tangents he seems to get into on every thread that have only the most tenuous (or none at all, like this notepad derail) connection to the topic at hand. Read my reply again, and you will find no hostility there. Either that, or you'll need to diversify and associate more, because internet forums tend to be an echo chamber.

@nosisab
Stop talking about Notepad already, I haven't used that program since 6 years ago. And I don't even know what NL FB is.
Also, the umlauts (non-ASCII characters) didn't show up in the game title, they were commented out (prefixed with // ). If I remember correctly, the gametitle= line is obsolete anyways and doesn't get printed, because the title from the GameIndex.dfb shows up instead.

@miseru99
I haven't actually checked whether PCSX2 reads Unicode-PNACHs at all, now that you mention it. I also haven't ever had a PCSX2CE .pnach NOT work, so i'm not faulting your program. Then again, I haven't tried entering non-ASCII characters though it yet.

[test]

So it turns out, encoding the patch file in UTF-8 or UTF-16 does actually allow PCSX2 to read it, no problem. Welp. That takes care of pretty much any and all special characters. You just gotta know. Still, default .txt files which are the template for patch files are by default created with ANSI character set on current Windows machines, which are likely a large part of the user base.

I imagine it's an easy-to-make mistake and I'm not even sure why I haven't stumbled across it sooner. So there's still the issue that the most widely used plain-text character encoding has the potential to break PCSX2's pnach reading capabilities.
Reply
#9
The parser breaks for non ASCII ANSI, characters, it works for unicode UTF-8.

The problem is not with unicode support but with the use of regional characters. Possibly the misunderstandings could have been avoided and maybe I would not jump on conclusions about something was wrong with whatever text editor you used if you did not jump on conclusions first. That's because the problem never happened to me and now I know a bit more, then the thread was not a total waste.

PS: I tested converting a pnach having such non ASCII characters in a comment line to ANSI (I had none in gametitles in all the pnachs) and it stopped working as reported, reconverted it to unicode and it worked once again.

PPS: And yes, would make a lot more sense asking for UTF-8 support on the OP than asking for regional support in whatever non English set.
Imagination is where we are truly real
Reply
#10
ANSI isn't a regional character set, though? Huh
It's standard ASCII with the standard Latin characters supplement. It's not like Latin characters are all that new, the language is like 2000 years old by now.

I didn't ask for UTF-8 support because it's a newer character set and also far more complex than extended ASCII, which has been in use on Windows machines for longer than some people that frequent this forum have been on this world. The standard it's based on (ISO 8859-1) has been published in 1987! At the time of thread creation, I didn't know it (Unicode) was already supported.

Did you know that ANSI is named after the American National Standards Institute? It's not like this is some kind of foreign thing.
Reply




Users browsing this thread: 1 Guest(s)