User:Adgarza: Difference between revisions
Content added Content deleted
(Convert from Unicode to ASCII) |
(Blanked the page) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{task}} |
|||
Convert unicode special characters to ASCII. |
|||
In Spanish language, there are accented and special characters like á, é, í, ó, ú, ü, ñ (all low case and upper case), as so signs to open a question (¿) and admiration (¡). There are many other special characters in other languages, but for the sake of this exercise you can only concentrate in the Spanish ones. |
|||
All this characters look weird when you read a text file like this (Spanish) in a DOS program: |
|||
<pre>"¡Ah, qué calor! ¡Cómo me haría falta una buena soda! Pero mañana tengo que |
|||
entregar esta tarea y ánimas que me alcance el tiempo para ello. ¿Cómo me |
|||
iría si entregase al último?"</pre> |
|||
(This translates into: "Oh, how hot! How I would need a good soda! But tomorrow I have to deliver this task and I hope to have enough time for it. What could happen to me if I am the last one to deliver it?") |
|||
The resulting text in DOS reads like this: |
|||
[[File:Screenshot of Unicode Spanish text in standard DOS program.jpg|Screenshot of Unicode Spanish text in standard DOS program]] |
|||
The task is to write a code able to convert from Unicode to ASCII. Following you'll find text lines to convert: |
|||
* ¡Ah, qué calor! |
|||
* ¡Cómo me haría falta una buena soda! |
|||
* Mañana tengo que entregar esta tarea y ánimas que me alcance el tiempo para ello. |
|||
* ¿Cómo me iría si entregase al último? |
|||
* Árbol que crece torcido, su tronco jamás endereza. |
|||
* Camarón que se duerme, se lo lleva la corriente. |
|||
* El murciélago voló anoche, como todo el año. |
|||
* Es rica el azúcar de caña. |
|||
* ¿Te ha gustado el ejercicio? |
|||
Would be desirable to do the contrary (from ASCII to Unicode). |