[
https://issues.apache.org/jira/browse/FELIX-5222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15208982#comment-15208982
]
Kisho Shin commented on FELIX-5222:
-----------------------------------
I found 3 USS related issues. All are related to the the fact that the Charset
on USS is IBM1047 (or another EBCDIC based Codepage).
*1. Reading gosh_profile*
In *org.apache.felix.gogo.shell.Shell>>#readScript*
The current code:
{code}
Reader reader = new InputStreamReader(in);
{code}
does not work, because gosh_profile is not IBM1047 encoded.
To fix this simply add the encoding:
{code}
Reader reader = new InputStreamReader(in,"ISO-8859-1");
{code}
*2. Reading motd*
Same problem as gosh_profile. I fix this by simply delete the line
{code}
cat ($0 resolve motd)
{code}
*3. Reading from System.in*
In *org.apache.felix.gogo.shell.Console>>#getLine* there is a cast from int to
char. This does not work with EBCDIC, because the int is interpreted as a
Unicode code point.
Instead of:
{code}
int c = in.read(); // where in == System.in
{code}
one must wrap this with an InputStreamReader. Somthing like:
{code}
InputStreamReader inStream = new InputStreamReader(System.in);
int c = inStream.read();
{code}
> z/OS USS: gosh_profile:1.1140: EOFException: unexpected EOT looking for
> matching quote
> --------------------------------------------------------------------------------------
>
> Key: FELIX-5222
> URL: https://issues.apache.org/jira/browse/FELIX-5222
> Project: Felix
> Issue Type: Bug
> Components: Gogo Runtime
> Affects Versions: gogo.runtime-0.10.0, gogo.runtime-0.16.2
> Environment: z/OS USS
> Reporter: Kisho Shin
>
> On z/OS USS I got this:
> {code}
> bundleresource://28.fwk-246498179/gosh_profile:1.1140: EOFException:
> unexpected EOT looking for matching quote: '
> java.io.EOFException: unexpected EOT looking for matching quote: '
> at org.apache.felix.gogo.runtime.Closure.setLocation(Closure.java:105)
> at org.apache.felix.gogo.runtime.Closure.<init>(Closure.java:65)
> at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:91)
> at org.apache.felix.gogo.shell.Shell.source(Shell.java:192)
> at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:109)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
> at java.lang.reflect.Method.invoke(Method.java:613)
> at
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
> at
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
> at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
> at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
> at
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
> at org.apache.felix.gogo.shell.Activator.run(Activator.java:75)
> at java.lang.Thread.run(Thread.java:777)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)