Repository navigation
Implement GETCP() - #2199
Implement GETCP()#2199
Conversation
|
Why are you excluding 620 and 895? |
|
Hi Robert, Yes, that's the reason. .NET has no encoding for 620 (Mazovia) and 895 (Kamenicky), so CPCONVERT() can't convert them and I left them out of the dialog too. I've added both commented out with a note, here and in the CPCONVERT() list. |
There was a problem hiding this comment.
🟡 Changes recommended
Two critical active issues remain: the test provider’s method is not used through interface dispatch, and adding GetCp to the public provider interface breaks existing custom providers.
2 open issues
What changed in this PR
Implements VFP GETCP() with validation, UI-provider routing, a platform-filtered code-page dialog, and headless behavior.
Changes:
- Added
GETCP()provider support and tests. - Added Select/Cancel code-page dialog handling.
- Removed the former stub.
| File | Description |
|---|---|
| src/Runtime/XSharp.VFP/UI/VfpUIService.prg | Extends the UI provider contract with code-page retrieval and headless fallback behavior. |
| src/Runtime/XSharp.VFP/UI/Dialogs.prg | Implements GETCP() argument validation and provider dispatch. |
| src/Runtime/XSharp.VFP/ToDo-G.prg | Removes the obsolete GETCP() stub. |
| src/Runtime/XSharp.VFP.UI/VfpUIProvider.prg | Connects the UI provider to the code-page selection dialog. |
| src/Runtime/XSharp.VFP.UI/CodePageForm.prg | Provides the platform-filtered code-page selection form. |
| src/Runtime/XSharp.VFP.Tests/GetCpTests.prg | Adds tests for argument handling, provider routing, and headless behavior. |
Review effort: Lite

GETCP() was a stub. Now it shows the Code Page dialog, with the platform filter, and returns the code page that was selected, or 0 if the dialog is cancelled.
The list has the code pages that CPCONVERT() supports, so 620 and 895 aren't there, and there's no Help button.