Bob Hall
Bob Hall
Would [iconv](https://www.gnu.org/software/libiconv/) be useful for this? At least for building a conversion dictionary.
Yes, it doesn't sound like a completely automatable solution is available. iconv will at least output a 0xFF character if it doesn't match the encoding set, so that will catch...
There's a perl module that guesses at the encoding of a text string: [https://metacpan.org/source/DANKOGAI/Encode-2.98/lib/Encode/Guess.pm](https://metacpan.org/source/DANKOGAI/Encode-2.98/lib/Encode/Guess.pm) [https://perldoc.perl.org/Encode/Guess.html](https://perldoc.perl.org/Encode/Guess.html) Perhaps that could be useful for deriving some coding logic?
This looks interesting: [https://github.com/neitanod/forceutf8/blob/master/src/ForceUTF8/Encoding.php](https://github.com/neitanod/forceutf8/blob/master/src/ForceUTF8/Encoding.php) Perhaps it can be used as an identification tool?
A thought occurred: it may be possible that neither NWN nor NWN2 is using those 3K fields. I searched the 2da files in NWN2 for a sample but found no...
"Converting isn't the problem, the issue is identification, which is not really 100% possible. Then there's the double-UTF-8. And if there's strings with multiple encodings, that's even more trouble." If...
Okay. Well I find it really cool all the file conversion and manipulation content you've developed here, but unless some character combinations are going to break the engine I'm not...
During testing of a new Journal class, I ran into what appears to be an error with strref #180942. This value is retrieved for the "construct" quest in the OC...
Can we catch such iconv errors in the GFF3Struct::getString call so we can at least get a report on the ResRef value where it failed?
A kludgy work-around then is to check the converted string within the getString call and print an informative warning message if it matches the error pattern?