Convert/normalize special characters like "ê" to regular "e"
Posted: Thu Nov 12, 2015 3:31 am
Hello! does anyone have a procedure to convert special characters such as "èéêë" to their regular counterpart "e" ? just a simple ASCII one that is
Im happy to make one myself of course (seems like itd be fun to try in asm) but i just had a feeling its already been done, but my searches were bleh!
Im not too keen on treating "Æ" -> "AE" (2 bytes) though as cant inline-replace then! and it's the only exception, so perhaps it should just -> "A" ... it does come immediately after the string of 5 other special A's afterall
{update} oh nice, i thought of searching for "Case 217" site:purebasic.fr, as i figured it might be part of the code, and sure enough came up with a valid (but just the one!) French thread
http://www.purebasic.fr/french/viewtopi ... =1&t=11888
None look particularly efficient though in regards to doing thousands of strings, so i still might try my luck at an asm version
Im happy to make one myself of course (seems like itd be fun to try in asm) but i just had a feeling its already been done, but my searches were bleh!
Code: Select all
For i = 181 To 256
s.s = s.s + Str(i) + ":" + Chr(i) + #TAB$
If Mod(i,10) = 0: s = s + #CRLF$: EndIf
Next i
Debug s
;... =
; 181:µ 182:¶ 183:· 184:¸ 185:¹ 186:º 187:» 188:¼ 189:½ 190:¾
; 191:¿ 192:À 193:Á 194:Â 195:Ã 196:Ä 197:Å 198:Æ 199:Ç 200:È
; 201:É 202:Ê 203:Ë 204:Ì 205:Í 206:Î 207:Ï 208:Ð 209:Ñ 210:Ò
; 211:Ó 212:Ô 213:Õ 214:Ö 215:× 216:Ø 217:Ù 218:Ú 219:Û 220:Ü
; 221:Ý 222:Þ 223:ß 224:à 225:á 226:â 227:ã 228:ä 229:å 230:æ
; 231:ç 232:è 233:é 234:ê 235:ë 236:ì 237:í 238:î 239:ï 240:ð
; 241:ñ 242:ò 243:ó 244:ô 245:õ 246:ö 247:÷ 248:ø 249:ù 250:ú
; 251:û 252:ü 253:ý 254:þ 255:ÿ
;My interpretation:
;181=u
;192-197=A
;198=(AE?)
;199=C
;200-203=E
;204-207=I
;208=D
;209=N
;210-214=O
;215=X
;216=O (or Q?)
;217-220=U
;221=Y
;222=(b?)
;223=B
;224-229=a
;230=(ae?)
;231=c
;232-235=e
;236-239=i
;240=(o?)
;241=n
;242-246=o
;249-252=u
;253=y
;254=(b?)
;255=y
{update} oh nice, i thought of searching for "Case 217" site:purebasic.fr, as i figured it might be part of the code, and sure enough came up with a valid (but just the one!) French thread

http://www.purebasic.fr/french/viewtopi ... =1&t=11888
None look particularly efficient though in regards to doing thousands of strings, so i still might try my luck at an asm version
