mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-22 00:55:09 +00:00
61 lines
2.7 KiB
Text
61 lines
2.7 KiB
Text
{{DISPLAYTITLE:_MAPUNICODE}}
|
|
The [[_MAPUNICODE]] statement maps a [[Unicode]] value to an [[ASCII]] character code value.
|
|
|
|
|
|
|
|
{{PageSyntax}}
|
|
: [[_MAPUNICODE]] {{Parameter|unicode&}} '''TO''' {{Parameter|asciiCode%}}
|
|
|
|
|
|
* The [[LONG]] {{Parameter|unicode&}} value is a [[HEX$|hexadecimal]] or decimal code value from a [[Unicode]] [[Code Pages|Code Page]].
|
|
* The {{Parameter|asciiCode%}} [[INTEGER]] parameter is any [[ASCII]] or Extended code value from 0 to 255.
|
|
* Use the Unicode Page Table values listed here: [http://en.wikipedia.org/wiki/Category:DOS_code_pages DOS Code Pages] or [http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/ Windows Mapping]
|
|
* Once the codes are mapped, key entries will display the unicode character in the '''monospace ''' [[_FONT|font]] selected.
|
|
* The [[_MAPUNICODE (function)|_MAPUNICODE]] function can be used to verify or read the present [[Unicode]] UTF32 code point settings.
|
|
* '''[[_MAPUNICODE]] can place the Unicode characters TO any [[ASCII]] code space you desire (0 to 255)'''.
|
|
|
|
|
|
{{PageExamples}}
|
|
''Example:'' Converting the extended [[ASCII]] characters to other characters using DATA from the Unicode [[Code Pages]].
|
|
{{CodeStart}} '' ''
|
|
{{Cl|SCREEN}} 0
|
|
{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\windows\fonts\cour.ttf", 20, "MONOSPACE")
|
|
|
|
{{Cl|RESTORE}} Microsoft_pc_cpMIK
|
|
{{Cl|FOR...NEXT|FOR}} ASCIIcode = 128 {{Cl|TO}} 255
|
|
{{Cl|READ}} unicode
|
|
{{Cl|_MAPUNICODE}} Unicode {{Cl|TO}} ASCIIcode
|
|
{{Cl|NEXT}}
|
|
|
|
|
|
{{Cl|FOR...NEXT|FOR}} i = 128 {{Cl|TO}} 255
|
|
{{Cl|PRINT}} {{Cl|CHR$}}(i) + " ";
|
|
cnt = cnt + 1
|
|
{{Cl|IF...THEN|IF}} cnt {{Cl|MOD}} 16 = 0 {{Cl|THEN}} {{Cl|PRINT}}
|
|
{{Cl|NEXT}}
|
|
{{Cl|END}}
|
|
|
|
Microsoft_pc_cpMIK:
|
|
{{Cl|DATA}} 1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055
|
|
{{Cl|DATA}} 1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071
|
|
{{Cl|DATA}} 1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087
|
|
{{Cl|DATA}} 1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103
|
|
{{Cl|DATA}} 9492,9524,9516,9500,9472,9532,9571,9553,9562,9566,9577,9574,9568,9552,9580,9488
|
|
{{Cl|DATA}} 9617,9618,9619,9474,9508,8470,167,9559,9565,9496,9484,9608,9604,9612,9616,9600
|
|
{{Cl|DATA}} 945,223,915,960,931,963,181,964,934,920,937,948,8734,966,949,8745
|
|
{{Cl|DATA}} 8801,177,8805,8804,8992,8993,247,8776,176,8729,183,8730,8319,178,9632,160 '' ''
|
|
{{CodeEnd}}
|
|
: ''Note:'' The Unicode data field is created by adding DATA before each line listed for the appropriate [[Code Pages|Code Page]].
|
|
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
* [[_MAPUNICODE (function)]]
|
|
* [[ASCII]], [[Unicode]], [[_FONT]]
|
|
* [[_KEYHIT]], [[_KEYDOWN]]
|
|
* [[ASC]], [[INKEY$]], [[CHR$]]
|
|
* [[Code Pages]] {{text|(by region)}}
|
|
* [[Text Using Graphics]]
|
|
|
|
|
|
{{PageNavigation}}
|