[ping] Different outputs affected by locale
Commit Message
On 06/13/2014 01:23 AM, Pedro Alves wrote:
> So what I'm thinking is indeed going with making the test
> accept the cent, but conditioned, like:
OK, that is more restrict.
>
> # Fallback to assuming 7-bit ASCII. Test are ran under LC_CTYPE=C.
>
> set cent "\\\\242"
>
> set test "show host-charset"
> gdb_test_multiple $test $test {
> -re "CP1252\r\n$gdb_prompt $" {
I tweak the pattern to match the output...
> # With Windows code page 1252 (Latin 1), the cent
> # is printable.
> set cent "\u00A2"
> pass $test
> }
> -re "$gdb_prompt $" {
> pass $test
> }
> }
... and how about the patch below?
Comments
On 06/17/2014 04:44 AM, Yao Qi wrote:
> On 06/13/2014 01:23 AM, Pedro Alves wrote:
>> So what I'm thinking is indeed going with making the test
>> accept the cent, but conditioned, like:
>
> OK, that is more restrict.
>
>>
>> # Fallback to assuming 7-bit ASCII. Test are ran under LC_CTYPE=C.
>>
>> set cent "\\\\242"
>>
>> set test "show host-charset"
>> gdb_test_multiple $test $test {
>> -re "CP1252\r\n$gdb_prompt $" {
>
> I tweak the pattern to match the output...
>
>> # With Windows code page 1252 (Latin 1), the cent
>> # is printable.
>> set cent "\u00A2"
>> pass $test
>> }
>> -re "$gdb_prompt $" {
>> pass $test
>> }
>> }
>
> ... and how about the patch below?
>
Looks good to me.
Thanks,
On 06/17/2014 06:03 PM, Pedro Alves wrote:
> Looks good to me.
Thanks for the review. Patch is pushed in.
@@ -37,6 +37,20 @@ gdb_test "print simple\[2\]" "= 99 L'c'"
gdb_test "print difficile\[2\]" "= 65261 L'\\\\xfeed'"
set cent "\\\\242"
+
+set test "show host-charset"
+gdb_test_multiple $test $test {
+ -re "CP1252\".*\r\n$gdb_prompt $" {
+ # With Windows code page 1252 (Latin 1), the cent
+ # is printable.
+ set cent "\u00A2"
+ pass $test
+ }
+ -re "$gdb_prompt $" {
+ pass $test
+ }
+}
+
gdb_test "print repeat" "= L\"A\", '$cent' <repeats 21 times>, \"B.*"
global hex