Replies inline.
On 7/9/2013 11:49 AM, whatt sson wrote:
I'm trying to edit an xml document on the ifs using RDP (8.5) but it seems
to have some trouble converting to/from UTF-8.
I have created the file on the IFS with CCSID 1208.
How? I used EDTF to create a file with a blank line, save it, exit
EDTF, re-run EDTF, F15 option 3 CCSID 1208, then paste <?xml
version="1.0" encoding="utf-8" ?> into the first line and saved it.
WRKLNK shows CCSID 1208.
Then i edit the file in RDP and put some text in it with latin-1
characters, such as ä.
Then i save the file but RDP converts to 1252 instead of 1208.
I opened my test.xml in RDP 8.5.1, changed to Source view and added
this: <test>Hélène says bonjour.</test> I am in the US, with a US
keyboard, so I typed the accented letters by holding down the Alt key
and pressing the numbers on the number pad: Alt+130 for é and Alt+138
for è. Then I saved the file. No warnings in RDP.
WRKLNK still shows CCSID 1208. EDTF shows a warning:
CPF9897 1 INVALID CHARCTERS FOR CCSID 01208 ENCOUNTERED IN DISPLAY
RECORD 3. IF THE RECORD IS CHANGED, THEY WILL BE REPLACED WITH
BLANKS.
Cause . . . . . : No additional online help information is available.
Exit EDTF.
Back to RDP, in RSE, right click the XML file -> Properties. I see that
file encoding is set to Default(Cp1252). I set it to Other UTF-8.
Apply, OK. I see funny characters in my RDP editor where my accents
used to be. I fix them and save.
WRKLNK shows 1208 and EDTF shows the accented characters properly. In
hex they are:
<test>
3C746573743E
Hélène
48C3A96CC3A86E65
When i put a latin-2 character in the text such as ř and then save to text
RDP complains and asks to convert it to UTF-8 (which i want it to do).
When I paste that character into my RDP editor and save, I see no
warnings in RDP. WRKLNK shows 1208, EDTF shows a non-displayable
character on my US English 5250 (CCSID 37) session. In hex it is:
<test2>
3C74657374323E
ř
C599
</test2>
3C2F74657374323E
How can i set RDP to always save in UTF-8 format.
Or even better, to respect to CCSID attribute of the IFS file.
I did not see a preference for this in regular RDP 8.5.1. Maybe it's
because RDP is not the web developer version - I think that is Rational
Business Developer? Just a guess.
In the general settings i have set the default CCSID to 1208 for XML files
(*.xml).
But this does not have any effect it seems.
General -> Appearance -> Content types. My XML type was set to UTF-8
(which is the default).
XML -> XML Files has what to do when /creating/ an XML file. Mine was
set to UTF-8 (which is the default).
RDP also behaves rather quirky with this.
When i explicitly choose to save to UTF-8 (when asked for it) it converts
incorrectly to the existing file (CCSID 1208).
When i create a new file with CCSID 1208 and save the same text then it
does convert to UTF-8.
RDP (or RDi) seems to be completely broken on this.
I'm not sure what is different between our setups. In my case, I must
remember to change the properties to UTF-8. That's clumsy but I
wouldn't call it completely broken. I hope this was some help; if only
to show where RDP ends and RBD begins.
--buck
As an Amazon Associate we earn from qualifying purchases.