Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Commit 9480110

Browse files
committed
Support non-ATOM Gmail labels - fix #334
1 parent 840c567 commit 9480110

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

doc/release/CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GH 323 Support loading protocol providers using ServiceLoader
3333
GH 326 Apply relaxed Content-Disposition parsing to Content-Disposition params
3434
GH 330 Attachment filename is ignored
3535
GH 332 http proxy support should support authenticating to the proxy server
36+
GH 334 gimap set labels error with some non english characters
3637

3738

3839
CHANGES IN THE 1.6.1 RELEASE

gimap/src/main/java/com/sun/mail/gimap/protocol/GmailProtocol.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -42,6 +42,7 @@
4242

4343
import java.io.*;
4444
import java.util.*;
45+
import java.nio.charset.StandardCharsets;
4546

4647
import com.sun.mail.iap.*;
4748
import com.sun.mail.imap.protocol.*;
@@ -192,11 +193,12 @@ private void storeLabels(String msgset, String[] labels, boolean set)
192193
handleResult(r[r.length-1]);
193194
}
194195

196+
// XXX - assume Gmail always supports UTF-8
195197
private Argument createLabelList(String[] labels) {
196198
Argument args = new Argument();
197199
Argument itemArgs = new Argument();
198200
for (int i = 0, len = labels.length; i < len; i++)
199-
itemArgs.writeAtom(labels[i]);
201+
itemArgs.writeString(labels[i], StandardCharsets.UTF_8);
200202
args.writeArgument(itemArgs);
201203
return args;
202204
}

0 commit comments

Comments
 (0)