j2me development, when writing Chinese characters to a file, the data at the end is lost

Updated on technology 2024-02-09
12 answers
  1. Anonymous users2024-02-05

    I don't think it's appropriate to use .,Including replacing GB2312 with UTF-8 will also be wrong.。。

    Doing it with a stream solves the problem.

    i.e. in the following forms:

    bytearrayoutputstream baos = new bytearrayoutputstream();

    dataoutputstream dos = new dataoutputstream();

    Chinese, including any characters");

    byte b1 = ;

    Once you have the target value b1, you can proceed with the following operations.

    My basis is:

    When using Bluetooth for PC and J2Me network streaming to transmit data, if you use the method you operate, there will be an error, and the content of missing arms and legs is saved in the RMS of the mobile phone, I ruled out the problem of network connection, because I am using a single byte transmission, and there is no problem of byte leakage.

  2. Anonymous users2024-02-04

    Chinese is not as good as English! You can see for yourself, though.

    This one is in English.

    This is the Chinese version.

    If it's because you can't understand the English version, you can check it under the next Kingsoft word bully or something like that, and you can read the API and learn English.

  3. Anonymous users2024-02-03

    stringbuffer s="a1bcde ";There is a space at the end.

    int width=getwidth();

    int sl;String length.

    int row;How many lines.

    for(int i=0;i=width)

    row++;

    sl=and the length of the space;

    and spaces here to copy the current string, skipping lines.

    elseint len= getwidthchar(;

    sl+=len;

    if(sl>=width)

    sl=0;row++;

    Here copy the current string and skip the line.

    Write a little bit casually.

  4. Anonymous users2024-02-02

    Is the string you output a given, or is it dynamic. Use a variable to store the width of the screen, and a variable to temporarily store the location of b (separated by commas), first find the position of the b character in a for loop, store the position of b with a string, and then process the string. Finally, I am making other judgments.

  5. Anonymous users2024-02-01

    string a = "01 02 03";

    a = " ", "0");

    Maybe you just executed; method, instead of using a string to accept this value.

    The replace() method returns the replaced string, rather than directly modifying the string that called the method

  6. Anonymous users2024-01-31

    " ","");That's it!

    Can you say that spaces are not characters? ""Isn't it a null character? As long as it's a byte, it's a character, and so is half a Chinese character. Huh

    Besides; The arguments in it can be strings!

  7. Anonymous users2024-01-30

    In the clouds!

    An expert said it well! Leave controls, styles, and interactions to HTML, CSS, and JS respectively!

  8. Anonymous users2024-01-29

    Do you want to implement a hyperlink?

    If you're in the advanced interface, use the StringItem's hyperlink style, and then listen to the item's command, and in the lower level, you'll draw a line under the text and watch for key events.

  9. Anonymous users2024-01-28

    Your text is used; Drawn, right? The first parameter of the drawstirng() method is the string you want to display, the second and third are displayed in **, that is, the x y coordinate point, and the fourth parameter is how to draw, this doesn't matter, 20 is the upper left.

    int i_x, i_y;

    public void paint(graphics g)public void update()

    The paint method is the paint method.

    You will see that the speed of movement is very fast, but the step size of your movement is indeed 1, because your refresh rate is high, you need to control the number of frames, if you need to control the number of frames, please let me know.

  10. Anonymous users2024-01-27

    == indicates that the physical memory addresses of the two strings are equal, and here they are obviously not equal.

    equal() indicates that the content of the two strings is equal. So this should be changed to:

    if("Enter here".equals(

  11. Anonymous users2024-01-26

    than string stuff.

    It's best to use. equals

    Don't write it with == you. equals("Enter here")

  12. Anonymous users2024-01-25

    Replacement of the entire character pose?

    Qinghui,"Inside is a regular expression.

Related questions
15 answers2024-02-09

Die, many people want to pass, and I haven't seen it yet.

19 answers2024-02-09

It's a very good machine, it's worth starting, and you have to believe in the quality of the big factory.

15 answers2024-02-09

Mobile phones are licensed. But be sure of the date of your purchase. If you bought it around 3/14/13, there is no problem, it means that you bought a new machine and activated it yourself. If you buy it now, it means that you are buying a second-hand phone.