| |
 | Gut zu wissen: Hilfreiche Tipps und Tricks aus der Praxis prägnant, und auf den Punkt gebracht für Autodesk Produkte |
| |
 | PNY: der unverzichtbare Partner für umfassende KI-Lösungen von Workstations bis zu Edge Computing und KI-Cluster-Bereitstellung, eine Pressemitteilung
|
Autor
|
Thema: Funktion AnsiToOem (1503 mal gelesen)
|
Bernd10 Mitglied
  
 Beiträge: 763 Registriert: 20.11.2003 Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz 16 GB RAM Windows 10 Pro 64-bit AutoCAD Mechnical 2020 Deu
|
erstellt am: 16. Jul. 2008 10:36 <-- editieren / zitieren --> Unities abgeben:         
Hallo, in C++ gibt es die Funktion AnsiToOem, die einen String von ANSI nach OEM konvertiert. In Visal Lisp habe ich sie im Fenster Apropos-Ergebnisse zwar gefunden (siehe Anlage), aber es gibt keine Hilfe dafür. Wie muss ich die Funktion ANSITOOEM in Visual Lisp verwenden? Gibt es eine alternative Funktion? Danke im Voraus und viele Grüße Bernd Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
wronzky Ehrenmitglied V.I.P. h.c. CAD-Dienstleistungen für Architekten

 Beiträge: 2154 Registriert: 02.05.2005 CAD: AutoCAD 2.6 bis 2014 ADT 2005 - 2014 Arcibem System: Windows 2000, XP, NO VISTA Internet-Startseite: http://www.archi.de
|
erstellt am: 16. Jul. 2008 11:55 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
Hi Bernd, ich hab' da was um OEM (Deutsch) nach Ansi zu transferieren. (für die schönen alten 12-er dwgs)... Du kannst es Dir ja entsprechend anpassen, also eigentlich nur die Zuordnungstabelle entsprechend "umdrehen". Code: (defun oem2ansi-ger (str / ) (setq oem850_ansi1252 '((128 . 199) (129 . 252) (130 . 233) (131 . 226) (132 . 228) (133 . 224) (134 . 229) (135 . 231) (136 . 234) (137 . 235) (138 . 232) (139 . 239) (140 . 238) (141 . 236) (142 . 196) (143 . 197) (144 . 201) (145 . 230) (146 . 198) (147 . 244) (148 . 246) (149 . 242) (150 . 251) (151 . 249) (152 . 255) (153 . 214) (154 . 220) (155 . 248) (156 . 163) (157 . 216) (158 . 215) (159 . 131) (160 . 225) (161 . 237) (162 . 243) (163 . 250) (164 . 241) (165 . 209) (166 . 170) (167 . 186) (168 . 191) (169 . 174) (170 . 172) (171 . 189) (172 . 188) (173 . 161) (174 . 171) (175 . 187) (176 . 166) (177 . 166) (178 . 166) (179 . 166) (180 . 166) (181 . 193) (182 . 194) (183 . 192) (184 . 169) (185 . 166) (186 . 166) (187 . 43) (188 . 43) (189 . 162) (190 . 165) (191 . 43) (192 . 43) (193 . 45) (194 . 45) (195 . 43) (196 . 45) (197 . 43) (198 . 227) (199 . 195) (200 . 43) (201 . 43) (202 . 45) (203 . 45) (204 . 166) (205 . 45) (206 . 43) (207 . 164) (208 . 240) (209 . 208) (210 . 202) (211 . 203) (212 . 200) (213 . 105) (214 . 205) (215 . 206) (216 . 207) (217 . 43) (218 . 43) (219 . 166) (220 . 95) (221 . 166) (222 . 204) (223 . 175) (224 . 211) (225 . 223) (226 . 212) (227 . 210) (228 . 245) (229 . 213) (230 . 181) (231 . 254) (232 . 222) (233 . 218) (234 . 219) (235 . 217) (236 . 253) (237 . 221) (238 . 175) (239 . 180) (240 . 173) (241 . 177) (242 . 61) (243 . 190) (244 . 182) (245 . 167) (246 . 247) (247 . 184) (248 . 176) (249 . 168) (250 . 183) (251 . 185) (252 . 179) (253 . 178) (254 . 166) (255 . 160) ) ) (merge-string (mapcar '(lambda (x) (if (setq l (cdr (assoc (ascii x) oem850_ansi1252))) (chr l) x)) (split-string str))) )(defun split-string (str / z return) (setq z 0) (repeat (strlen str) (setq return (cons (substr str (setq z (1+ z)) 1) return)) ) (reverse return) ) (defun merge-string (lst / z return) (setq return "" z -1) (repeat (length lst) (setq return (strcat return (nth (setq z (1+ z)) lst))) ) return )
Grüsse, Henning PS: Wenn Du Dir die Mühe machst, poste doch die neue Tabelle hier! ------------------ Henning Jesse VoxelManufaktur Computer-Dienstleistungen für Architekten und Ingenieure http://www.voxelman.de Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
Bernd10 Mitglied
  
 Beiträge: 763 Registriert: 20.11.2003 Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz 16 GB RAM Windows 10 Pro 64-bit AutoCAD Mechnical 2020 Deu
|
erstellt am: 16. Jul. 2008 12:11 <-- editieren / zitieren --> Unities abgeben:         
Hallo Henning, Zitat: Original erstellt von wronzky:
ich hab' da was um OEM (Deutsch) nach Ansi zu transferieren. (für die schönen alten 12-er dwgs)... Du kannst es Dir ja entsprechend anpassen, also eigentlich nur die Zuordnungstabelle entsprechend "umdrehen".
so in der Art habe ich es bereits für die Umlaute gemacht. Dadurch bin ich aber bei dem Zeichen ì auf die Nase gefallen. Hast Du in Deiner Zuordnungstabelle alle Zeichen berücksichtigt? Gruß Bernd
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
wronzky Ehrenmitglied V.I.P. h.c. CAD-Dienstleistungen für Architekten

 Beiträge: 2154 Registriert: 02.05.2005 CAD: AutoCAD 2.6 bis 2014 ADT 2005 - 2014 Arcibem System: Windows 2000, XP, NO VISTA Internet-Startseite: http://www.archi.de
|
erstellt am: 16. Jul. 2008 12:19 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
Hallo Bernd, ...probieren geht über studieren... Zitat: Hast Du in Deiner Zuordnungstabelle alle Zeichen berücksichtigt?
 Das ist ja der Sinn einer Zuordnungstabelle ... alle Zeichen des erweiterten ASCII-Satzes von 128 bis 255, also auch í, ì, è, é etc... Grüsse, Henning ------------------ Henning Jesse VoxelManufaktur Computer-Dienstleistungen für Architekten und Ingenieure http://www.voxelman.de [Diese Nachricht wurde von wronzky am 16. Jul. 2008 editiert.] Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
Bernd10 Mitglied
  
 Beiträge: 763 Registriert: 20.11.2003 Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz 16 GB RAM Windows 10 Pro 64-bit AutoCAD Mechnical 2020 Deu
|
erstellt am: 16. Jul. 2008 14:19 <-- editieren / zitieren --> Unities abgeben:         
Hallo Henning, Zitat: Original erstellt von wronzky:
PS: Wenn Du Dir die Mühe machst, poste doch die neue Tabelle hier!
wie gewünscht: 43 187 43 188 43 191 43 192 43 195 43 197 43 200 43 201 43 206 43 217 43 218 45 193 45 194 45 196 45 202 45 203 45 205 61 242 95 220 105 213 131 159 160 255 161 173 162 189 163 156 164 207 165 190 166 176 166 177 166 178 166 179 166 180 166 185 166 186 166 204 166 219 166 221 166 254 167 245 168 249 169 184 170 166 171 174 172 170 173 240 174 169 175 223 175 238 176 248 177 241 178 253 179 252 180 239 181 230 182 244 183 250 184 247 185 251 186 167 187 175 188 172 189 171 190 243 191 168 192 183 193 181 194 182 195 199 196 142 197 143 198 146 199 128 200 212 201 144 202 210 203 211 204 222 205 214 206 215 207 216 208 209 209 165 210 227 211 224 212 226 213 229 214 153 215 158 216 157 217 235 218 233 219 234 220 154 221 237 222 232 223 225 224 133 225 160 226 131 227 198 228 132 229 134 230 145 231 135 232 138 233 130 234 136 235 137 236 141 237 161 238 140 239 139 240 208 241 164 242 149 243 162 244 147 245 228 246 148 247 246 248 155 249 151 250 163 251 150 252 129 253 236 254 231 255 152 Danke nochmals und viele Grüße Bernd
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
wronzky Ehrenmitglied V.I.P. h.c. CAD-Dienstleistungen für Architekten

 Beiträge: 2154 Registriert: 02.05.2005 CAD: AutoCAD 2.6 bis 2014 ADT 2005 - 2014 Arcibem System: Windows 2000, XP, NO VISTA Internet-Startseite: http://www.archi.de
|
erstellt am: 16. Jul. 2008 14:27 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
Hi Bernd, scheint also geklappt zu haben. Danke für die Liste. (Hier nochmal schnell Lispkonform) Code: ((43 . 187) (43 . 188) (43 . 191) (43 . 192) (43 . 195) (43 . 197) (43 . 200) (43 . 201) (43 . 206) (43 . 217) (43 . 218) (45 . 193) (45 . 194) (45 . 196) (45 . 202) (45 . 203) (45 . 205) (61 . 242) (95 . 220) (105 . 213) (131 . 159) (160 . 255) (161 . 173) (162 . 189) (163 . 156) (164 . 207) (165 . 190) (166 . 176) (166 . 177) (166 . 178) (166 . 179) (166 . 180) (166 . 185) (166 . 186) (166 . 204) (166 . 219) (166 . 221) (166 . 254) (167 . 245) (168 . 249) (169 . 184) (170 . 166) (171 . 174) (172 . 170) (173 . 240) (174 . 169) (175 . 223) (175 . 238) (176 . 248) (177 . 241) (178 . 253) (179 . 252) (180 . 239) (181 . 230) (182 . 244) (183 . 250) (184 . 247) (185 . 251) (186 . 167) (187 . 175) (188 . 172) (189 . 171) (190 . 243) (191 . 168) (192 . 183) (193 . 181) (194 . 182) (195 . 199) (196 . 142) (197 . 143) (198 . 146) (199 . 128) (200 . 212) (201 . 144) (202 . 210) (203 . 211) (204 . 222) (205 . 214) (206 . 215) (207 . 216) (208 . 209) (209 . 165) (210 . 227) (211 . 224) (212 . 226) (213 . 229) (214 . 153) (215 . 158) (216 . 157) (217 . 235) (218 . 233) (219 . 234) (220 . 154) (221 . 237) (222 . 232) (223 . 225) (224 . 133) (225 . 160) (226 . 131) (227 . 198) (228 . 132) (229 . 134) (230 . 145) (231 . 135) (232 . 138) (233 . 130) (234 . 136) (235 . 137) (236 . 141) (237 . 161) (238 . 140) (239 . 139) (240 . 208) (241 . 164) (242 . 149) (243 . 162) (244 . 147) (245 . 228) (246 . 148) (247 . 246) (248 . 155) (249 . 151) (250 . 163) (251 . 150) (252 . 129) (253 . 236) (254 . 231) (255 . 152))
Grüsse, Henning------------------ Henning Jesse VoxelManufaktur Computer-Dienstleistungen für Architekten und Ingenieure http://www.voxelman.de Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
fuchsi Mitglied Programmierer c#.net Datawarehouse
   
 Beiträge: 1201 Registriert: 14.10.2003 AutoCad Version 2012 deu/enu <P>Windows 7 64bit
|
erstellt am: 17. Jul. 2008 15:12 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
Zitat: Original erstellt von Bernd10: Hallo Henning, wie gewünscht: 43 187 43 188 43 191 43 192 43 195 43 197 43 200 43 201 43 206 43 217 43 218 45 193 45 194 45 196 45 202 45 203 45 205 61 242 95 220
Kapier ich nicht. Wieso soll man + - = _ umschlüsseln. Die sind doch eh in beiden Systemem gleich, oder nicht ? Zumindest wärs mir noch nie anders aufgefallen. ------------------ Ing. Anton Fuchs WWW.FFZELL.AT.TC Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
Bernd10 Mitglied
  
 Beiträge: 763 Registriert: 20.11.2003 Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz 16 GB RAM Windows 10 Pro 64-bit AutoCAD Mechnical 2020 Deu
|
erstellt am: 17. Jul. 2008 15:27 <-- editieren / zitieren --> Unities abgeben:         
Hallo Anton, Zitat: Original erstellt von fuchsi: Kapier ich nicht. Wieso soll man [b]+ - = _ umschlüsseln. Die sind doch eh in beiden Systemem gleich, oder nicht ?Zumindest wärs mir noch nie anders aufgefallen. [/B]
Du hast recht. Ich habe inzwischen diese C++-Funktion geschrieben, die die Datei in der Anlage erstellt: void CDateiExport::TabelleAnsiToOem() { // Der Tabelle die Überschriften entsprechend dem Lisp-Format hinzufügen CStringListDbh strlTabelle; strlTabelle.AddTail("[ASCII-Zeichen Windows -> DOS]"); strlTabelle.AddTail("[gemäß C++-Funktion TabelleAnsiToOem]"); // Die Tabellenwerte gegebenenfalls hinzufügen int nMax = 255; int nAnsi; for (nAnsi = 32; nAnsi <= nMax; nAnsi++) { CString strOem(nAnsi); strOem.AnsiToOem(); int nOem = strOem[0]; if (nOem < 0) { nOem = nMax + 1 + nOem; // sonst nicht vergleichbar } if (nAnsi != nOem) { CString strZeile; strZeile.Format("%3d %3d ; %c",nAnsi,nOem,nAnsi); strlTabelle.AddTail(strZeile); } } // Die Tabelle in eine Datei schreiben CString strDatei = "C:\\Temp\\TabelleAnsiToOem.txt"; CDateiASCII daTabelle; daTabelle.Schreiben(strDatei,strlTabelle); } Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
fuchsi Mitglied Programmierer c#.net Datawarehouse
   
 Beiträge: 1201 Registriert: 14.10.2003 AutoCad Version 2012 deu/enu <P>Windows 7 64bit
|
erstellt am: 17. Jul. 2008 15:41 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
Interresant. Ich dachte immer, dass die Konvertierung komplett umkehrbar ist. Aber wenn verschiedene Windows-Zeichen auf ein und das selbe DOS Zeichen konvertiert werden, so ist eine Umkehrung nicht mehr möglich. Oder auch Z.B.: Das Hatschek Z Ansi 142 wird zu DOS 90 (und das ist das normale Z) ------------------ Ing. Anton Fuchs WWW.FFZELL.AT.TC Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
fuchsi Mitglied Programmierer c#.net Datawarehouse
   
 Beiträge: 1201 Registriert: 14.10.2003 AutoCad Version 2012 deu/enu <P>Windows 7 64bit
|
erstellt am: 17. Jul. 2008 15:50 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
laut der Windows API Oem2Char müsste die Liste folgendermassen ausschauen Code: (list (cons 128 199) (cons 129 252) (cons 130 233) (cons 131 226) (cons 132 228) (cons 133 224) (cons 134 229) (cons 135 231) (cons 136 234) (cons 137 235) (cons 138 232) (cons 139 239) (cons 140 238) (cons 141 236) (cons 142 196) (cons 143 197) (cons 144 201) (cons 145 230) (cons 146 198) (cons 147 244) (cons 148 246) (cons 149 242) (cons 150 251) (cons 151 249) (cons 152 255) (cons 153 214) (cons 154 220) (cons 155 248) (cons 156 163) (cons 157 216) (cons 158 215) (cons 159 131) (cons 160 225) (cons 161 237) (cons 162 243) (cons 163 250) (cons 164 241) (cons 165 209) (cons 166 170) (cons 167 186) (cons 168 191) (cons 169 174) (cons 170 172) (cons 171 189) (cons 172 188) (cons 173 161) (cons 174 171) (cons 175 187) (cons 176 166) (cons 177 166) (cons 178 166) (cons 179 166) (cons 180 166) (cons 181 193) (cons 182 194) (cons 183 192) (cons 184 169) (cons 185 166) (cons 186 166) (cons 187 43) (cons 188 43) (cons 189 162) (cons 190 165) (cons 191 43) (cons 192 43) (cons 193 45) (cons 194 45) (cons 195 43) (cons 196 45) (cons 197 43) (cons 198 227) (cons 199 195) (cons 200 43) (cons 201 43) (cons 202 45) (cons 203 45) (cons 204 166) (cons 205 45) (cons 206 43) (cons 207 164) (cons 208 240) (cons 209 208) (cons 210 202) (cons 211 203) (cons 212 200) (cons 213 105) (cons 214 205) (cons 215 206) (cons 216 207) (cons 217 43) (cons 218 43) (cons 219 166) (cons 220 95) (cons 221 166) (cons 222 204) (cons 223 175) (cons 224 211) (cons 225 223) (cons 226 212) (cons 227 210) (cons 228 245) (cons 229 213) (cons 230 181) (cons 231 254) (cons 232 222) (cons 233 218) (cons 234 219) (cons 235 217) (cons 236 253) (cons 237 221) (cons 238 175) (cons 239 180) (cons 240 173) (cons 241 177) (cons 242 61) (cons 243 190) (cons 244 182) (cons 245 167) (cons 246 247) (cons 247 184) (cons 248 176) (cons 249 168) (cons 250 183) (cons 251 185) (cons 252 179) (cons 253 178) (cons 254 166) (cons 255 160) )
------------------ Ing. Anton Fuchs WWW.FFZELL.AT.TC Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
wronzky Ehrenmitglied V.I.P. h.c. CAD-Dienstleistungen für Architekten

 Beiträge: 2154 Registriert: 02.05.2005 CAD: AutoCAD 2.6 bis 2014 ADT 2005 - 2014 Arcibem System: Windows 2000, XP, NO VISTA Internet-Startseite: http://www.archi.de
|
erstellt am: 17. Jul. 2008 16:27 <-- editieren / zitieren --> Unities abgeben:          Nur für Bernd10
|