Jump to content

[CR] Convert between ASCII and Unicode


Recommended Posts

  • 4 months later...
Posted

In 'Convert Unicode to ASCII.vi', I don't think the increment should be there.

Feeding the results of 'Convert ASCII to Unicode.vi' into 'Convert Unicode to ASCII.vi' should give back the original string.

Pat Lavezza

Posted
What about this solution?

That algorithm is much faster than the original one - thanks! (I always forget about that bloody interleve thing!) I've updated the submission :)

Posted
That algorithm is much faster than the original one - thanks! (I always forget about that bloody interleve thing!) I've updated the submission :)

I actually hadn't noticed that you could resize 'Replace Array Subset' for use on several elements before - as you used it in the original code.

You learn - or relearn - something every day :D

-Mikkel :)

Posted
What about these solutions ?

post-447-1162561515.png?width=400

In my crude 'benchmark' your ASCII->UNICODE is actually slightly slower that my solution.

But yours does have a higher 'coolness/simplicity'-score :thumbup:

-Mikkel :)

Posted
What about these solutions ?

post-447-1162561515.png?width=400

Your UNIcode -> ASCII doesn't check that the first character is a \00 (if it is, then it's part of an extended character set and hence non-ASCII).

Posted

It seems unlikely that your UNICODE-->ASCII works given all the possible UNICODE encodings. I say this, not because I'm an expert in Unicode, but because I know how much I don't know. For example,

http://billposer.org/Software/uni2ascii.html

This is an open source ASCII-->UNICODE-->ASCII tool. Notice the revision history? This simple tool has a change log that goes for pages and talks about support for multiple encodings, etc. Further, the standards document for unicode has *chapters*. Compare that with your standard listing of the ASCII standard, which is just a table of 256 characters.

Here's the motherload of information about unicode:

http://www.unicode.org/unicode/faq/

Posted
It seems unlikely that your UNICODE-->ASCII works given all the possible UNICODE encodings. I say this, not because I'm an expert in Unicode, but because I know how much I don't know.

You're absolutely right - my submission only works for the 7bit ASCII page, not any of the extended or other pages (it actually checks that the UNIcode input is convertable to the 7bit page). As you suggest, a code snippet that covers all pages would be comprehensive indeed.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.