Post Reply 
newRPL: [UPDATED April 27-2017] Firmware for testing available for download
10-20-2016, 12:30 AM (This post was last modified: 10-20-2016 09:17 AM by matthiaspaul.)
Post: #424
RE: newRPL: [UPDATED September-17-16] Firmware for testing available for download
There's another compatibility enhancement which could be implemented into newRPL to automatically work around a bug in the original HP 49g+/50g firmware.

As we have seen in the other thread, when the original firmware creates LFNs, it does not perform any translation of the HP49/50 character set into Unicode, codepoints 80h..FFh are just zero-padded to 16-bit to fit into the UCS-2 slots.
This is fine for codepoints A1h..FFh, which are the same for the HP49/50 character set, ISO 8859-1 and Unicode. However, the code assignments differ for codepoints 80h..A0h.

While codepoints 80h..A0h are valid characters in LFNs, at least 80h..9Fh do not make any sense at all in a filename (they are control codes in Unicode). This could be used for an heuristical extension:

If newRPL encounters a code 0080h..009Fh in a LFN, it could blindly map these invalid codes to the correct Unicode codes:

0080h (PAD) -> 2221h (∡)
0081h (HOP) -> 0101h (ā)
0082h (BPH) -> 2207h (∇)
0083h (NBH) -> 221Ah (√)
0084h (IND) -> 222Bh (∫)
0085h (NEL) -> 03A3h (Σ)
0086h (SSA) -> 25B6h (▶)
0087h (ESA) -> 03C0h (π)
0088h (HTS) -> 2202h (π)
0089h (HTJ) -> 2264h (≤)
008Ah (LTS) -> 2265h (≥)
008Bh (PLD) -> 2260h (≠)
008Ch (PLU) -> 03B1h (α)
008Dh (RI) -> 2192h (→)
008Eh (SS2) -> 2190h (←)
008Fh (SS3) -> 2193h (↓)
0090h (DCS) -> 2191h (↑)
0091h (PU1) -> 03B3h (γ)
0092h (PU2) -> 03B4h (δ)
0093h (STS) -> 03B5h (ε)
0094h (CCH) -> 03B7h (η)
0095h (MW) -> 03B8h (θ)
0096h (SPA) -> 03BBh (λ)
0097h (EPA) -> 03C1h (ρ)
0098h (SOS) -> 03C3h (σ)
0099h (SGCI) -> 03C4h (τ)
009Ah (SCI) -> 03C9h (ω)
009Bh (CSI) -> 0394h (Δ)
009Ch (ST) -> 03A0h (Π)
009Dh (OSC) -> 03A9h (Ω)
009Eh (PM) -> 25A0h (■)
009Fh (APC) -> 221Eh (∞)

00A0h (NBSP) -> 20ACh (€)

This doesn't work for 00A0h, as NBSP cannot be ruled out as a valid character in a filename. So, without further info newRPL cannot decide if 00A0h means 20ACh (as for files created under the original HP 49g+/50g firmware) or 00A0h (as for files created anywhere else, including newRPL).
One such further indicator could be the following: If at least one LFN character is from the 0080h..009Fh range, the calculator knows that the file was created on the HP49/50 and thus can reliably assume that 00A0h means 20ACh. Obviously, this automatic detection does not work for filenames without any of these characters, but as it does not cause any harm, it is better than nothing already. Without this indicator, it is more safe to assume 00A0h, and translating this to 20ACh might require a special "compatibility" mode to be activated by the user.

In either case, this extension only works for the direction "file created under original firmware and read under newRPL". Translating the correct Unicode characters back into the 0080h..009Fh range, so that they are understood by the original firmware, should happen only in a special "compatibility" mode (if at all).



"Programs are poems for computers."
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: newRPL: [UPDATED September-17-16] Firmware for testing available for download - matthiaspaul - 10-20-2016 12:30 AM

User(s) browsing this thread: 2 Guest(s)