PDSOE scratchpad (11.3) ignores source code code-page settin

Posted by andrew.may on 10-Oct-2014 05:48

The following code behaves oddly in the scratchpad, I suspect that the issue is that the scratchpad doesn't respect Eclipse source-file codepage settings & just assumes that source is in cp1252 when compiling.

output to c:\scratchpad\pound.txt convert source "utf-8" target "1252".
put unformatted "£" skip.
output close.

I've got a pure UTF-8 setup... source is UTF-8 encoded, as is cpinternal, cpstream etc...

If I create a new project & save the code below as a new .p & run it, it does the expected thing of displaying the pound (sterling) sign in cp1252  (i.e. the hex value 0xA3)

If I run it from the scratchpad (in the new project's AVM), I get no errors, but the file it produces is a load of garbage.

Some testing has suggested that the problem is with the  parsing of the literal "£" in the source code.

If I replace the "£" with

chr(163,"utf-8","1252")

i.e. "the £ sign in UTF-8"
... then the program works as expected.

If I save the source in the scratchpad, then the saved source is in cp1252.  However, the scratchpad editor UI is encoding in UTF8 & can accept entry of & render any unicode character.

Does anyone have a workaround, or is this just a bug to log?

All Replies

Posted by bronco on 10-Oct-2014 10:41

when you goto Windows > preferences and then to General > Workspace you probably see that the default encoding is 1252. You have propbably overriden this (did you?). This default comes from the underlying JVM. There are two possibilities:

- you haven't set set encoding on the workspace level, do it here

- you did, in that case the scratchpad ignores this setting. In this case you can set the default encoding in eclipse.ini (in the <DLC>\oeide\eclipse dir) by adding:

-Dfile.encoding=UTF-8

hth

Posted by andrew.may on 13-Oct-2014 05:53

Thanks Bronco,

My workspace default was already UTF8, but my JVM default wasn't.

Changing the JVM default fixed the issue.

It looks like the scratchpad doesn't respect the workspace settings  (I've logged an idea to fix this).

This thread is closed