# Converting user-supplied strings/text to EBCDIC hexadecimal characters

**URL:** <https://discourse.julialang.org/t/converting-user-supplied-strings-text-to-ebcdic-hexadecimal-characters/56120>\
**Category:** New to Julia\
**Tags:** strings, convert, parsing\
**Created:** [February 26, 2021, 9:24pm UTC](https://discourse.julialang.org/t/converting-user-supplied-strings-text-to-ebcdic-hexadecimal-characters/56120 "2021-02-26T21:24:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 27, 2021, 7:36pm UTC](https://discourse.julialang.org/t/converting-user-supplied-strings-text-to-ebcdic-hexadecimal-characters/56120/2 "2021-02-27T19:36:43Z")

</div>

Welcome to the _Julia_ language community.

I just had to answer, as this may be the most obscure question I’ve seen on Julia discourse, no offense.

May I ask, why? Is it just curiosity with programming, or dare I say school assignment?

It seem what you may be after is:

> **[GitHub - JuliaStrings/StringEncodings.jl: String encoding conversion in Julia...](https://github.com/JuliaStrings/StringEncodings.jl)**
>
> String encoding conversion in Julia using iconv. Contribute to JuliaStrings/StringEncodings.jl development by creating an account on GitHub.

Note, Julia only supports UTF-8, as it’s the default for the future (but you can also do 8-bit byte strings with no, or user-defined meaning). And well UTF-16 to/from UTF-8 (for e.g. Windows). Intentionally other encodings are left out, _of the standard library_, including Latin1 etc. let alone obscure like EBCDIC.

Note, ASCII is supported by (7-bit) ASCII being a subset of UTF-8. “Extended ASCII”

If you need any of that, you must use a package, such as that one (there might be more).

[If there’s anything more obscure, it might be UTF-EBCDIC.]

You wouldn’t be able to convert everything from a webpage to EBCDIC (or ASCII), if you allow any UTF-8 input as it seems you’re doing.

There are some other threads such as this one that might be helpful:

> [@Decoding EBCDIC array to string](https://discourse.julialang.org/t/decoding-ebcdic-array-to-string/26192):
>
> I have a file format that returns bytes in EBCDIC format: 3200-element Array{UInt8,1}: 0xc3 0x40 0xf1 0x40 0xc3 0xd3 0xc9 0xc5 0xd5 0xe3 0x7a 0x40 0xc2 ⋮ 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 When I copy the bytes before … into an [online converter](http://www.longpelaexpertise.com/toolsCode.php) with EBCDIC 0037 formatting, I get the correct value: Bytes: x" 0XC3 0X40 0XF1 0X40 0XC3 0XD3 0XC9 0XC5 0XD5 0XE3 0X7A 0X40 0XC2 " ASCII String: Ã@ñ@ÃÓÉÅÕãz@Â EBCDIC String: C 1 CLIENT: B I’m tryin…

You CAN do web programming in Julia (your question wasn’t how), but I see the code you use is for a different language, likely JavaScript? And you can use it with, or avoid it, but if it works for you great. Then the question is likely warranted elsewhere. I’m not sure, but did you post to this community by accident?

FYI: EBCDIC-platforms, i.e. mainframes, are not supported by Julia. I realize you’re not targeting those?! Just having a valid question on converting the encoding, that you can do on any platform.

---

_[View the full topic](https://discourse.julialang.org/t/converting-user-supplied-strings-text-to-ebcdic-hexadecimal-characters/56120)._
