Bug 367863 - add string encoding="ebcdic"
Summary: add string encoding="ebcdic"
Status: RESOLVED FIXED
Alias: None
Product: okteta
Classification: Applications
Component: Structures Tool (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Alex Richardson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-26 17:55 UTC by Aaron Bishop
Modified: 2016-10-27 17:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Bishop 2016-08-26 17:55:45 UTC
version 0.19.3 (not in version list)

I'm trying to make structures for ANSI X9.37 files, but ASCII strings aren't working for EBCDIC encoded files. It's great that I can change the encoding in the data window, but structures don't respect that encoding.

Reproducible: Always

Steps to Reproduce:
1. Make file with the following hex:
C8 85 93 93 96 40 E6 96 99 93 84 5A
2. Make a .ods with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<data><struct name="ebcdic_example"><string name="hello_world" length="12" encoding="ebcdic" /></struct></data>

3. Load the structure and your file, click Script Console.

Actual Results:  
Unrecognized string encoding "ebcdic"
Bad string encoding given: "ebcdic"

Expected Results:  
1 structure named ebcdic_example with 1 field named hello_world with the contents "Hello World!"
Comment 1 Alex Richardson 2016-08-26 22:08:52 UTC
Added to my to do list. However, I am quite busy at the moment and probably won't have time to work on okteta for the next 2 months.
Comment 2 Aaron Bishop 2016-08-29 12:51:14 UTC
Submitted https://git.reviewboard.kde.org/r/128795/
Comment 3 Alex Richardson 2016-08-29 16:01:49 UTC
Thank you very much for the patch.

Unfortunately I can't see the review request, it says
"You don't have access to this review request.

This review request is private. You must be a requested reviewer, either directly or on a requested group, and have permission to access the repository in order to view this review request."

Possibly you didn't click publish yet?
Comment 4 Aaron Bishop 2016-08-30 17:57:28 UTC
I didn't publish, sorry. First time submitting a patch to a KDE project. I added you as a reviewer and published.
Comment 5 Alex Richardson 2016-10-27 17:15:14 UTC
Git commit b455b93cb15fb3af078c48e70f326aa6efe6275e by Alex Richardson, on behalf of Aaron Bishop.
Committed on 27/10/2016 at 17:15.
Pushed by arichardson into branch 'master'.

add encoding="ebcdic" to string structures

fix bug 367863 structures string encoding ebcdic

Testing Done:
builds, tested example from bug 367863 and it behaves as expected. ctest passes 100% of 54 tests. I only added one test condition to commonparsertest.

REVIEW: 128795

M  +2    -0    kasten/controllers/CMakeLists.txt
M  +2    -0    kasten/controllers/test/commonparsertest.cpp
A  +160  -0    kasten/controllers/view/structures/datatypes/strings/ebcdicstringdata.cpp     [License: LGPL]
A  +55   -0    kasten/controllers/view/structures/datatypes/strings/ebcdicstringdata.h     [License: LGPL]
M  +5    -0    kasten/controllers/view/structures/datatypes/strings/stringdatainformation.cpp
M  +3    -2    kasten/controllers/view/structures/datatypes/strings/stringdatainformation.h
M  +3    -0    kasten/controllers/view/structures/parsers/parserutils.cpp

http://commits.kde.org/okteta/b455b93cb15fb3af078c48e70f326aa6efe6275e