# String representation of hexadecimal to unicode character

**URL:** https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289
**Category:** General Usage
**Tags:** strings, unicode
**Created:** [April 27, 2020, 9:10am UTC](https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289 "2020-04-27T09:10:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![HugoTrentesaux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hugotrentesaux/32/12583_2.png) [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)
#### Post date: [April 27, 2020, 9:10am UTC](https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289/1 "2020-04-27T09:10:23Z")

</div>

Is there a builtin function to transform the string representation of an hexadecimal to the corresponding unicode character?

```julia
# we can for example do
julia> Char(0x03C0)
'π': Unicode U+03c0 (category Ll: Letter, lowercase)
# but what if we want to go from string to character ?
julia> Char(xxx("03C0"))
'π': Unicode U+03c0 (category Ll: Letter, lowercase)

```

what would be the function `xxx` above?

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [April 27, 2020, 9:16am UTC](https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289/2 "2020-04-27T09:16:44Z")

</div>

`xxx == parse`:

```julia
julia> Char(parse(UInt32, "03C0", base=16))
'π': Unicode U+03C0 (category Ll: Letter, lowercase)

```

---

<div class="post-metadata">

### Author: ![HugoTrentesaux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hugotrentesaux/32/12583_2.png) [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)
#### Post date: [April 27, 2020, 3:47pm UTC](https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289/3 "2020-04-27T15:47:32Z")

</div>

Thanks!

I still do not get why this is case insensitive:

```julia
# uppercase
julia> Char(parse(UInt32, "03C0", base=16))
'π': Unicode U+03c0 (category Ll: Letter, lowercase)
# lowercase
julia> Char(parse(UInt32, "03c0", base=16))
'π': Unicode U+03c0 (category Ll: Letter, lowercase)

```

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [April 27, 2020, 4:00pm UTC](https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289/4 "2020-04-27T16:00:17Z")

</div>

> [@HugoTrentesaux](#):
>
> I still do not get why this is case insensitive:

Hexadecimal parsing in Julia is case-insensitive everywhere (you can also type `0x03C0` instead of `0x03c0`, for example). Why would you want case-sensitive behavior?

---

<div class="post-metadata">

### Author: ![HugoTrentesaux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hugotrentesaux/32/12583_2.png) [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)
#### Post date: [April 27, 2020, 5:12pm UTC](https://discourse.julialang.org/t/string-representation-of-hexadecimal-to-unicode-character/38289/5 "2020-04-27T17:12:00Z")

</div>

I was expecting case-sensitiveness because I was thinking about the reverse transformation of:

```julia
julia> convert(Int,'A')
65
julia> convert(Int,'a')
97

```

but now it’s clear it isn’t the same 🙂
