Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate utf32(Integer...) method? #11379

Closed
ScottPJones opened this issue May 20, 2015 · 6 comments
Closed

deprecate utf32(Integer...) method? #11379

ScottPJones opened this issue May 20, 2015 · 6 comments
Labels
domain:unicode Related to unicode characters and encodings

Comments

@ScottPJones
Copy link
Contributor

utf32 has the following method:

function utf32(c::Integer...)

However, neither utf8 nor utf16 have that functionality...
(also, the utf32 version does no validity checking, which it probably should).

Either the method for utf32 (and the test in strings.jl) should be deprecated and then removed,
or utf8 and utf16 should be make to act consistently (and add validity checking).

@tkelman tkelman added the domain:unicode Related to unicode characters and encodings label May 20, 2015
@stevengj
Copy link
Member

Deprecating it seems reasonable.

@stevengj stevengj changed the title Inconsistent methods for utf8, utf16, and utf32 deprecate utf32(Integer...) method? May 20, 2015
@ScottPJones
Copy link
Contributor Author

👍 or 👎 on utf32(Integer...)? Just like the Romans...
What is the best thing to put for the replacement?
I imagine something like utf32([...]), but I don't know how to convert the c::Integer... into a Vector{Integer}[c...].

@StefanKarpinski
Copy link
Sponsor Member

👎 on utf32(Integer...). Not sure why we have that. Probably my fault.

@stevengj
Copy link
Member

@deprecate utf32(c::Integer...) utf32([c...]) should do it, no?

@ScottPJones
Copy link
Contributor Author

OK, that almost worked... got an error because of no method:

ERROR: MethodError: `convert` has no method matching convert(::Type{UTF32String}, ::Array{Int64,1})

however utf32(UInt32[c...]) works fine... I can go ahead and make a PR...
utf32([c...]) might have worked on a 32-bit system...

@stevengj
Copy link
Member

No, you're right, I was missing the type specifier. Integer could be any integer type (Int8, BigInt, whatever), so we need to convert it to UInt32 regardless of the platform.

ScottPJones added a commit to ScottPJones/julia that referenced this issue May 21, 2015
stevengj added a commit that referenced this issue May 23, 2015
mbauman pushed a commit to mbauman/julia that referenced this issue Jun 6, 2015
tkelman pushed a commit to tkelman/julia that referenced this issue Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:unicode Related to unicode characters and encodings
Projects
None yet
Development

No branches or pull requests

4 participants