pgj commented on code in PR #4828:
URL: https://github.com/apache/couchdb/pull/4828#discussion_r1380662149


##########
src/mango/src/mango_idx_view.erl:
##########
@@ -417,7 +417,7 @@ range(_, _, LCmp, Low, HCmp, High) ->
 % beginsWith requires both a high and low bound
 range({[{<<"$beginsWith">>, Arg}]}, LCmp, Low, HCmp, High) ->
     {LCmp0, Low0, HCmp0, High0} = range({[{<<"$gte">>, Arg}]}, LCmp, Low, 
HCmp, High),
-    range({[{<<"$lte">>, <<Arg/binary, 16#10FFFF>>}]}, LCmp0, Low0, HCmp0, 
High0);
+    range({[{<<"$lte">>, <<Arg/binary, 16#10FFFF/utf8>>}]}, LCmp0, Low0, 
HCmp0, High0);

Review Comment:
   Yes, that completely makes sense.  In retrospect, it is quite logical that 
the collation algorithm may define arbitrary ordering over the values 
independently of their numerical representation.  It may not be that efficient 
though.
   
   I am somewhat old school in terms of character encodings (despite being a 
person for who the letters in the native language does not fit in 7-bit ASCII – 
ISO-8859-2 for the win! But I was able to do the move to IPv6 recently so there 
is still hope for me... :smile:)



##########
src/mango/src/mango_idx_view.erl:
##########
@@ -417,7 +417,7 @@ range(_, _, LCmp, Low, HCmp, High) ->
 % beginsWith requires both a high and low bound
 range({[{<<"$beginsWith">>, Arg}]}, LCmp, Low, HCmp, High) ->
     {LCmp0, Low0, HCmp0, High0} = range({[{<<"$gte">>, Arg}]}, LCmp, Low, 
HCmp, High),
-    range({[{<<"$lte">>, <<Arg/binary, 16#10FFFF>>}]}, LCmp0, Low0, HCmp0, 
High0);
+    range({[{<<"$lte">>, <<Arg/binary, 16#10FFFF/utf8>>}]}, LCmp0, Low0, 
HCmp0, High0);

Review Comment:
   Yes, that completely makes sense.  In retrospect, it is quite logical that 
the collation algorithm may define arbitrary ordering over the values 
independently of their numerical representation.  It may not be that efficient 
though.
   
   I am somewhat old school in terms of character encodings (despite being a 
person for who the letters in the native language does not fit in 7-bit ASCII – 
ISO-8859-2 for the win! But I was able to do the move to IPv6 recently so there 
is still hope for me... :smile:)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to