12-14-2025, 05:56 AM
During my study of QB64, I've encountered two confusing issues:
_PRINTSTRING: When used within a VIEW viewport, it doesn't seem to support relative coordinates, whereas _UPRINTSTRING works fine with them. Given how similar they are, it seems like _PRINTSTRING should also be able to use relative coordinates.
Chinese input via _INPUTBOX$: I can input Chinese characters normally in the pop-up dialog, but the returned string is garbled. Typically, a Chinese character in GBK encoding is 2 bytes, but the string returned by this function appears to be 4 bytes per character. The character encoding doesn't seem to match GBK, UTF-8, or UTF-16, making it impossible to convert and use correctly. While _MESSAGEBOX can normally display Chinese text, the characters returned by _INPUTBOX$ cannot even be displayed properly by the _MESSAGEBOX statement.
I hope to get some help from everyone. Thank you.
![[Image: image.png]](https://i.ibb.co/S4jNBP54/image.png)
![[Image: image.png]](https://i.ibb.co/bM79qGkj/image.png)
_PRINTSTRING: When used within a VIEW viewport, it doesn't seem to support relative coordinates, whereas _UPRINTSTRING works fine with them. Given how similar they are, it seems like _PRINTSTRING should also be able to use relative coordinates.
Chinese input via _INPUTBOX$: I can input Chinese characters normally in the pop-up dialog, but the returned string is garbled. Typically, a Chinese character in GBK encoding is 2 bytes, but the string returned by this function appears to be 4 bytes per character. The character encoding doesn't seem to match GBK, UTF-8, or UTF-16, making it impossible to convert and use correctly. While _MESSAGEBOX can normally display Chinese text, the characters returned by _INPUTBOX$ cannot even be displayed properly by the _MESSAGEBOX statement.
I hope to get some help from everyone. Thank you.
Code: (Select All)
Screen 12
test$ = "Hello world!"
View (10, 180)-(610, 380), , 3
_PrintString (0, 0), test$ + " _printstring"
_UPrintString (300, 0), test$ + " _uprintstring"
View
Do: k$ = InKey$: Loop Until k$ <> ""
Cls
chn$ = "QB64pe初学者"
_MessageBox "Message Correct", chn$, "info"
_MessageBox "Show InputBox Result", _InputBox$("Inputbox", "The default text displays correctly.", chn$), "warning"
![[Image: image.png]](https://i.ibb.co/S4jNBP54/image.png)
![[Image: image.png]](https://i.ibb.co/bM79qGkj/image.png)

