|
From: SourceForge.net <no...@so...> - 2003-09-21 18:44:09
|
Bugs item #810211, was opened at 2003-09-21 18:22 Message generated for change (Comment added) made by donstauffer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=810211&group_id=2435 Category: MinGW Group: None Status: Open Resolution: None Priority: 5 Submitted By: Don Stauffer (donstauffer) Assigned to: Earnie Boyd (earnie) Summary: Make changes character set in command execution but not echo Initial Comment: Under Windows 2000 Professional and MSYS 1.0.9, when MinGW Make 3.80.0-3 runs a command (echo, for instance), characters above 127 don't seem to be in any identifiable code page. Make's command echo (when it displays the command - I'm not referring to the "echo command" here), however, appears to always use code page 1252. Changing the TERM environment variable or using the Windows chcp.com doesn't change make's behavior in MSYS. I've found the same behavior in the make 3.79.1 distributed with MinGW 1.1, but the make 3.79.1 distributed with MSYS 1.0.9 is different. It uses code page 1252 for both command echoing and output. Run in a Win2K command prompt, with the Lucida Console font (the default Raster font doesn't support upper character codes), the results are similar. With code page 437 or 850 the output is different from the echo, for the same two make versions, and MSYS 1.0.9 make 3.79.1 seems to use code page 1252 for echo and output, no matter what. The differences are that with code page 437 or 850 set using chcp.com, the echo uses the chosen code page and the output appears to use 1252 no matter what. Looking at the actual character codes output, character code 0xA3, the pound (currency) sign in the echo, seems to have been translated into code 0x9C in the output. In code page 1252, as well as ISO 8859-1 (both Latin 1 character sets), character 0xA3 is the pound sign. In code page 437, character 0x9C is the pound sign. So, it seems like make is echoing the characters as command arguments using their original codes, and then translating the character codes to Latin-1, but the command is not using Latin-1 to display them. That would explain their correctness under the Windows command prompt when chcp.com is set to 1252. Make translates character 0xFF (non-breaking space in cp 437) to 0xA0 (non-breaking space in cp 1252), which displays as Latin small a with acute in cp 437. This is consistant with my testing in a command prompt. The translation also explains the appearance of displaying in cp 437 when chcp.com is set to 1252: the characters are translated into their 1252 counterparts. MSYS appears to have the opposite problem, translating the characters after echo to cp 437, but displaying them in cp 1252, no matter what. For another, complementary example, the character originally 0xA0 echoes as a (probably non-breaking) space, its meaning in Latin-1, but outputs 0xFF, which would be a non- blocking space in cp 437, but it actually displays a Latin small letter Y with diaeresis, which is 0xFF in cp 1252. Here's an example makefile and it's output in MSYS: # ASCII codes X := ${subst , ,} T := ${subst , ,} define escAllChars \001 \002 \003 \004 \005 \006 \007 \010 \011 \012 \013 \014 \015 \016 \017 \020 \021 \022 \023 \024 \025 \026 \027 \030 \031 \032 \033 \034 \035 \036 \037 \040 \041 \042 \043 \044 \045 \046 \047 \050 \051 \052 \053 \054 \055 \056 \057 \060 \061 \062 \063 \064 \065 \066 \067 \070 \071 \072 \073 \074 \075 \076 \077 \100 \101 \102 \103 \104 \105 \106 \107 \110 \111 \112 \113 \114 \115 \116 \117 \120 \121 \122 \123 \124 \125 \126 \127 \130 \131 \132 \133 \134 \135 \136 \137 \140 \141 \142 \143 \144 \145 \146 \147 \150 \151 \152 \153 \154 \155 \156 \157 \160 \161 \162 \163 \164 \165 \166 \167 \170 \171 \172 \173 \174 \175 \176 \177 \200 \201 \202 \203 \204 \205 \206 \207 \210 \211 \212 \213 \214 \215 \216 \217 \220 \221 \222 \223 \224 \225 \226 \227 \230 \231 \232 \233 \234 \235 \236 \237 \240 \241 \242 \243 \244 \245 \246 \247 \250 \251 \252 \253 \254 \255 \256 \257 \260 \261 \262 \263 \264 \265 \266 \267 \270 \271 \272 \273 \274 \275 \276 \277 \300 \301 \302 \303 \304 \305 \306 \307 \310 \311 \312 \313 \314 \315 \316 \317 \320 \321 \322 \323 \324 \325 \326 \327 \330 \331 \332 \333 \334 \335 \336 \337 \340 \341 \342 \343 \344 \345 \346 \347 \350 \351 \352 \353 \354 \355 \356 \357 \360 \361 \362 \363 \364 \365 \366 \367 \370 \371 \372 \373 \374 \375 \376 \377 endef allChars := ${shell echo -e '${strip ${escAllChars}}'} B := ${word 8,${allChars}} allCharsPlugged := ${subst $B$X$T$X$X,$B$XT$XN,${allChars}} F := ${word 12,${allCharsPlugged}} A := ${subst $X$X$X,$XX$X,${allCharsPlugged}} .PHONY : example example : @echo Here are the characters above 127: @printf "\n" echo '${wordlist 128,${words $A},$A}' Here's the output; interestingly, these pasted characters look rather similar to the ones in the MSYS window I copied it from, but some of the characters are different. $ mingw32-make Here are the characters above 127: echo ' ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ' _ _ , , . + Ø ^ % S < O _ Z _ _ ` ' - - ~ T s > o _ z Y ÿ Ý c ¦ ® ª - r _ ø ñ ý 3 æ ú , 1 § ¯ ¬ « _ ¨ A A A A E E E I I I I D ¥ O O O O x O U U U Y _ á a ¡ d ¤ ¢ o ö o £ y _ " ---------------------------------------------------------------------- >Comment By: Don Stauffer (donstauffer) Date: 2003-09-21 18:44 Message: Logged In: YES user_id=861460 Important Note: This does NOT seem to affect the ${shell ...} function. It only seems to be a problem with commands in rules. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=810211&group_id=2435 |